26 #if defined (HAVE_CONFIG_H)
52 for (
int i = 0; i < nd; i++)
71 m = to_f77_int (tmp_m);
72 n = to_f77_int (tmp_n);
73 k = to_f77_int (tmp_k);
97 int nargin = args.length ();
99 if (nargin < 2 || nargin > 3)
107 error (
"dot: X and Y must be numeric");
111 bool match = dimx == dimy;
115 dimx = dimx.
redim (1);
117 dimy = dimy.
redim (1);
119 match = dimx == dimy;
123 error (
"dot: sizes of X and Y must match");
129 dim = args(2).int_value (
true) - 1;
132 error (
"dot: DIM must be a valid dimension");
142 get_red_dims (dimx, dimy, dim, dimz,
m,
n, k);
154 get_red_dims (dimx, dimy, dim, dimz,
m,
n, k);
169 get_red_dims (dimx, dimy, dim, dimz,
m,
n, k);
180 get_red_dims (dimx, dimy, dim, dimz,
m,
n, k);
252 template <
typename T>
287 x.data (), y.
data (),
297 x.data (), y.
data (),
306 int nd = dimx.
ndims ();
308 m = to_f77_int (dimx(0));
309 k = to_f77_int (dimx(1));
310 n = to_f77_int (dimy(1));
314 bool match = ((dimy(0) == k) && (nd == dimy.
ndims ()));
320 for (
int i = 2; match && i < nd; i++)
322 match = (dimx(i) == dimy(i));
327 np = to_f77_int (tmp_np);
330 error (
"blkmm: A and B dimensions don't match: (%s) and (%s)",
331 dimx.
str ().c_str (), dimy.
str ().c_str ());
334 template <
typename T>
338 const T
x = octave_value_extract<T> (xov);
339 const T y = octave_value_extract<T> (yov);
343 get_blkmm_dims (
x.dims (), y.dims (),
m,
n, k, np, dimz);
347 if (
n != 0 &&
m != 0)
348 blkmm_internal<T> (
x, y, z,
m,
n, k, np);
353 DEFUN (blkmm, args, ,
372 if (args.length () != 2)
381 error (
"blkmm: A and B must be numeric");
386 retval = do_blkmm<FloatComplexNDArray> (argx, argy);
388 retval = do_blkmm<ComplexNDArray> (argx, argy);
393 retval = do_blkmm<FloatNDArray> (argx, argy);
395 retval = do_blkmm<NDArray> (argx, argy);
439 OCTAVE_END_NAMESPACE(
octave)
octave_value_list Fsum(const octave_value_list &=octave_value_list(), int=0)
subroutine cdotc3(m, n, k, a, b, c)
T * fortran_vec()
Size of the specified dimension.
const T * data() const
Size of the specified dimension.
Vector representing the dimensions (size) of an Array.
std::string str(char sep='x') const
static dim_vector alloc(int n)
octave_idx_type ndims() const
Number of dimensions.
int first_non_singleton(int def=0) const
dim_vector redim(int n) const
Force certain dimensionality, preserving numel ().
ComplexNDArray complex_array_value(bool frc_str_conv=false) const
bool is_single_type() const
octave_value reshape(const dim_vector &dv) const
NDArray array_value(bool frc_str_conv=false) const
FloatComplexNDArray float_complex_array_value(bool frc_str_conv=false) const
FloatNDArray float_array_value(bool frc_str_conv=false) const
subroutine cmatm3(m, n, k, np, a, b, c)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
subroutine ddot3(m, n, k, a, b, c)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
subroutine dmatm3(m, n, k, np, a, b, c)
T do_blkmm(const octave_value &xov, const octave_value &yov)
void blkmm_internal(const FloatComplexNDArray &x, const FloatComplexNDArray &y, FloatComplexNDArray &z, F77_INT m, F77_INT n, F77_INT k, F77_INT np)
void() error(const char *fmt,...)
#define F77_CONST_CMPLX_ARG(x)
#define F77_DBLE_CMPLX_ARG(x)
#define F77_XFCN(f, F, args)
octave_f77_int_type F77_INT
#define F77_CONST_DBLE_CMPLX_ARG(x)
double dot(const ColumnVector &v1, const ColumnVector &v2)
F77_RET_T const F77_DBLE * x
octave_value binary_op(type_info &ti, octave_value::binary_op op, const octave_value &a, const octave_value &b)
subroutine sdot3(m, n, k, a, b, c)
subroutine smatm3(m, n, k, np, a, b, c)
subroutine zdotc3(m, n, k, a, b, c)
subroutine zmatm3(m, n, k, np, a, b, c)