Navigation

Operators and Keywords

Function List:

C++ API

Sparse-op-defs.h File Reference

#include "Array-util.h"
#include "mx-ops.h"
#include "oct-locbuf.h"

Include dependency graph for Sparse-op-defs.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Defines

#define octave_sparse_op_defs_h   1
#define SPARSE_BIN_OP_DECL(R, OP, X, Y, API)   extern API R OP (const X&, const Y&)
#define SPARSE_CMP_OP_DECL(OP, X, Y, API)   extern API SparseBoolMatrix OP (const X&, const Y&)
#define SPARSE_BOOL_OP_DECL(OP, X, Y, API)   extern API SparseBoolMatrix OP (const X&, const Y&)
#define SPARSE_SMS_BIN_OP_DECLS(R1, R2, M, S, API)
#define SPARSE_SMS_BIN_OP_1(R, F, OP, M, S)
#define SPARSE_SMS_BIN_OP_2(R, F, OP, M, S)
#define SPARSE_SMS_BIN_OPS(R1, R2, M, S)
#define SPARSE_SMS_CMP_OP_DECLS(M, S, API)
#define SPARSE_SMS_EQNE_OP_DECLS(M, S, API)
#define SPARSE_SMS_CMP_OP(F, OP, M, MZ, MC, S, SZ, SC)
#define SPARSE_SMS_CMP_OPS(M, MZ, CM, S, SZ, CS)
#define SPARSE_SMS_EQNE_OPS(M, MZ, CM, S, SZ, CS)
#define SPARSE_SMS_BOOL_OP_DECLS(M, S, API)
#define SPARSE_SMS_BOOL_OP(F, OP, M, S, LHS_ZERO, RHS_ZERO)
#define SPARSE_SMS_BOOL_OPS2(M, S, LHS_ZERO, RHS_ZERO)
#define SPARSE_SMS_BOOL_OPS(M, S, ZERO)   SPARSE_SMS_BOOL_OPS2(M, S, ZERO, ZERO)
#define SPARSE_SMS_OP_DECLS(R1, R2, M, S, API)
#define SPARSE_SSM_BIN_OP_DECLS(R1, R2, S, M, API)
#define SPARSE_SSM_BIN_OP_1(R, F, OP, S, M)
#define SPARSE_SSM_BIN_OP_2(R, F, OP, S, M)
#define SPARSE_SSM_BIN_OPS(R1, R2, S, M)
#define SPARSE_SSM_CMP_OP_DECLS(S, M, API)
#define SPARSE_SSM_EQNE_OP_DECLS(S, M, API)
#define SPARSE_SSM_CMP_OP(F, OP, S, SZ, SC, M, MZ, MC)
#define SPARSE_SSM_CMP_OPS(S, SZ, SC, M, MZ, MC)
#define SPARSE_SSM_EQNE_OPS(S, SZ, SC, M, MZ, MC)
#define SPARSE_SSM_BOOL_OP_DECLS(S, M, API)
#define SPARSE_SSM_BOOL_OP(F, OP, S, M, LHS_ZERO, RHS_ZERO)
#define SPARSE_SSM_BOOL_OPS2(S, M, LHS_ZERO, RHS_ZERO)
#define SPARSE_SSM_BOOL_OPS(S, M, ZERO)   SPARSE_SSM_BOOL_OPS2(S, M, ZERO, ZERO)
#define SPARSE_SSM_OP_DECLS(R1, R2, S, M, API)
#define SPARSE_SMSM_BIN_OP_DECLS(R1, R2, M1, M2, API)
#define SPARSE_SMSM_BIN_OP_1(R, F, OP, M1, M2)
#define SPARSE_SMSM_BIN_OP_2(R, F, OP, M1, M2)
#define SPARSE_SMSM_BIN_OP_3(R, F, OP, M1, M2)
#define SPARSE_SMSM_BIN_OPS(R1, R2, M1, M2)
#define SPARSE_SMSM_CMP_OP_DECLS(M1, M2, API)
#define SPARSE_SMSM_EQNE_OP_DECLS(M1, M2, API)
#define SPARSE_SMSM_CMP_OP(F, OP, M1, Z1, C1, M2, Z2, C2)
#define SPARSE_SMSM_CMP_OPS(M1, Z1, C1, M2, Z2, C2)
#define SPARSE_SMSM_EQNE_OPS(M1, Z1, C1, M2, Z2, C2)
#define SPARSE_SMSM_BOOL_OP_DECLS(M1, M2, API)
#define SPARSE_SMSM_BOOL_OP(F, OP, M1, M2, LHS_ZERO, RHS_ZERO)
#define SPARSE_SMSM_BOOL_OPS2(M1, M2, LHS_ZERO, RHS_ZERO)
#define SPARSE_SMSM_BOOL_OPS(M1, M2, ZERO)   SPARSE_SMSM_BOOL_OPS2(M1, M2, ZERO, ZERO)
#define SPARSE_SMSM_OP_DECLS(R1, R2, M1, M2, API)
#define SPARSE_MSM_BIN_OP_DECLS(R1, R2, M1, M2, API)
#define SPARSE_MSM_BIN_OP_1(R, F, OP, M1, M2)
#define SPARSE_MSM_BIN_OP_2(R, F, OP, M1, M2, ZERO)
#define SPARSE_MSM_BIN_OPS(R1, R2, M1, M2)
#define SPARSE_MSM_CMP_OP_DECLS(M1, M2, API)
#define SPARSE_MSM_EQNE_OP_DECLS(M1, M2, API)
#define SPARSE_MSM_CMP_OP(F, OP, M1, C1, M2, C2)
#define SPARSE_MSM_CMP_OPS(M1, Z1, C1, M2, Z2, C2)
#define SPARSE_MSM_EQNE_OPS(M1, Z1, C1, M2, Z2, C2)
#define SPARSE_MSM_BOOL_OP_DECLS(M1, M2, API)
#define SPARSE_MSM_BOOL_OP(F, OP, M1, M2, LHS_ZERO, RHS_ZERO)
#define SPARSE_MSM_BOOL_OPS2(M1, M2, LHS_ZERO, RHS_ZERO)
#define SPARSE_MSM_BOOL_OPS(M1, M2, ZERO)   SPARSE_MSM_BOOL_OPS2(M1, M2, ZERO, ZERO)
#define SPARSE_MSM_OP_DECLS(R1, R2, M1, M2, API)
#define SPARSE_SMM_BIN_OP_DECLS(R1, R2, M1, M2, API)
#define SPARSE_SMM_BIN_OP_1(R, F, OP, M1, M2)
#define SPARSE_SMM_BIN_OP_2(R, F, OP, M1, M2, ZERO)
#define SPARSE_SMM_BIN_OPS(R1, R2, M1, M2)
#define SPARSE_SMM_CMP_OP_DECLS(M1, M2, API)
#define SPARSE_SMM_EQNE_OP_DECLS(M1, M2, API)
#define SPARSE_SMM_CMP_OP(F, OP, M1, C1, M2, C2)
#define SPARSE_SMM_CMP_OPS(M1, Z1, C1, M2, Z2, C2)
#define SPARSE_SMM_EQNE_OPS(M1, Z1, C1, M2, Z2, C2)
#define SPARSE_SMM_BOOL_OP_DECLS(M1, M2, API)
#define SPARSE_SMM_BOOL_OP(F, OP, M1, M2, LHS_ZERO, RHS_ZERO)
#define SPARSE_SMM_BOOL_OPS2(M1, M2, LHS_ZERO, RHS_ZERO)
#define SPARSE_SMM_BOOL_OPS(M1, M2, ZERO)   SPARSE_SMM_BOOL_OPS2(M1, M2, ZERO, ZERO)
#define SPARSE_SMM_OP_DECLS(R1, R2, M1, M2, API)
#define SPARSE_CUMSUM(RET_TYPE, ELT_TYPE, FCN)
#define SPARSE_CUMPROD(RET_TYPE, ELT_TYPE, FCN)
#define SPARSE_BASE_REDUCTION_OP(RET_TYPE, EL_TYPE, ROW_EXPR, COL_EXPR, INIT_VAL, MT_RESULT)
#define SPARSE_REDUCTION_OP_ROW_EXPR(OP)   tmp[ridx(i)] OP data (i)
#define SPARSE_REDUCTION_OP_COL_EXPR(OP)   tmp[j] OP data (i)
#define SPARSE_REDUCTION_OP(RET_TYPE, EL_TYPE, OP, INIT_VAL, MT_RESULT)
#define SPARSE_ANY_ALL_OP_ROW_CODE(TEST_OP, TEST_TRUE_VAL)
#define SPARSE_ANY_ALL_OP_COL_CODE(TEST_OP, TEST_TRUE_VAL)
#define SPARSE_ANY_ALL_OP(DIM, INIT_VAL, MT_RESULT, TEST_OP, TEST_TRUE_VAL)
#define SPARSE_ALL_OP(DIM)
#define SPARSE_ANY_OP(DIM)   SPARSE_ANY_ALL_OP (DIM, false, false, !=, true)
#define SPARSE_SPARSE_MUL(RET_TYPE, RET_EL_TYPE, EL_TYPE)
#define SPARSE_FULL_MUL(RET_TYPE, EL_TYPE, ZERO)
#define SPARSE_FULL_TRANS_MUL(RET_TYPE, EL_TYPE, ZERO, CONJ_OP)
#define FULL_SPARSE_MUL(RET_TYPE, EL_TYPE, ZERO)
#define FULL_SPARSE_MUL_TRANS(RET_TYPE, EL_TYPE, ZERO, CONJ_OP)

Define Documentation

#define FULL_SPARSE_MUL ( RET_TYPE,
EL_TYPE,
ZERO   ) 

#define FULL_SPARSE_MUL_TRANS ( RET_TYPE,
EL_TYPE,
ZERO,
CONJ_OP   ) 

#define octave_sparse_op_defs_h   1

#define SPARSE_ALL_OP ( DIM   ) 

Value:

if ((rows() == 1 && dim == -1) || dim == 1) \
    return transpose (). all (0). transpose(); \
  else \
    { \
      SPARSE_ANY_ALL_OP (DIM, (cidx(j+1) - cidx(j) < nr ? false : true), \
                         true, ==, false); \
    }

#define SPARSE_ANY_ALL_OP ( DIM,
INIT_VAL,
MT_RESULT,
TEST_OP,
TEST_TRUE_VAL   ) 

Value:

SPARSE_BASE_REDUCTION_OP (SparseBoolMatrix, char, \
                        SPARSE_ANY_ALL_OP_ROW_CODE (TEST_OP, TEST_TRUE_VAL), \
                        SPARSE_ANY_ALL_OP_COL_CODE (TEST_OP, TEST_TRUE_VAL), \
                        INIT_VAL, MT_RESULT)

#define SPARSE_ANY_ALL_OP_COL_CODE ( TEST_OP,
TEST_TRUE_VAL   ) 

Value:

if (data (i) TEST_OP 0.0) \
    { \
      tmp[j] = TEST_TRUE_VAL; \
      break; \
    }

#define SPARSE_ANY_ALL_OP_ROW_CODE ( TEST_OP,
TEST_TRUE_VAL   ) 

Value:

if (data (i) TEST_OP 0.0) \
    tmp[ridx(i)] = TEST_TRUE_VAL; \

#define SPARSE_ANY_OP ( DIM   )     SPARSE_ANY_ALL_OP (DIM, false, false, !=, true)

#define SPARSE_BASE_REDUCTION_OP ( RET_TYPE,
EL_TYPE,
ROW_EXPR,
COL_EXPR,
INIT_VAL,
MT_RESULT   ) 

#define SPARSE_BIN_OP_DECL ( R,
OP,
X,
Y,
API   )     extern API R OP (const X&, const Y&)

#define SPARSE_BOOL_OP_DECL ( OP,
X,
Y,
API   )     extern API SparseBoolMatrix OP (const X&, const Y&)

#define SPARSE_CMP_OP_DECL ( OP,
X,
Y,
API   )     extern API SparseBoolMatrix OP (const X&, const Y&)

#define SPARSE_CUMPROD ( RET_TYPE,
ELT_TYPE,
FCN   ) 

#define SPARSE_CUMSUM ( RET_TYPE,
ELT_TYPE,
FCN   ) 

#define SPARSE_FULL_MUL ( RET_TYPE,
EL_TYPE,
ZERO   ) 

#define SPARSE_FULL_TRANS_MUL ( RET_TYPE,
EL_TYPE,
ZERO,
CONJ_OP   ) 

#define SPARSE_MSM_BIN_OP_1 ( R,
F,
OP,
M1,
M2   ) 

Value:

R \
  F (const M1& m1, const M2& m2) \
  { \
    R r; \
 \
    octave_idx_type m1_nr = m1.rows (); \
    octave_idx_type m1_nc = m1.cols (); \
 \
    octave_idx_type m2_nr = m2.rows (); \
    octave_idx_type m2_nc = m2.cols (); \
 \
    if (m2_nr == 1 && m2_nc == 1) \
      r = R (m1 OP m2.elem(0,0)); \
    else if (m1_nr != m2_nr || m1_nc != m2_nc) \
      gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
    else \
      { \
        r = R (m1_nr, m1_nc); \
        \
        for (octave_idx_type j = 0; j < m1_nc; j++) \
          for (octave_idx_type i = 0; i < m1_nr; i++) \
            r.elem (i, j) = m1.elem (i, j) OP m2.elem (i, j); \
      } \
    return r; \
  }

#define SPARSE_MSM_BIN_OP_2 ( R,
F,
OP,
M1,
M2,
ZERO   ) 

#define SPARSE_MSM_BIN_OP_DECLS ( R1,
R2,
M1,
M2,
API   ) 

Value:

SPARSE_BIN_OP_DECL (R1, operator +, M1, M2, API); \
  SPARSE_BIN_OP_DECL (R1, operator -, M1, M2, API); \
  SPARSE_BIN_OP_DECL (R2, product,    M1, M2, API); \
  SPARSE_BIN_OP_DECL (R2, quotient,   M1, M2, API);

#define SPARSE_MSM_BIN_OPS ( R1,
R2,
M1,
M2   ) 

Value:

SPARSE_MSM_BIN_OP_1 (R1, operator +,  +, M1, M2) \
  SPARSE_MSM_BIN_OP_1 (R1, operator -,  -, M1, M2) \
  SPARSE_MSM_BIN_OP_2 (R2, product,     *, M1, M2, 0.0) \
  SPARSE_MSM_BIN_OP_2 (R2, quotient,    /, M1, M2, 0.0)

#define SPARSE_MSM_BOOL_OP ( F,
OP,
M1,
M2,
LHS_ZERO,
RHS_ZERO   ) 

#define SPARSE_MSM_BOOL_OP_DECLS ( M1,
M2,
API   ) 

Value:

SPARSE_BOOL_OP_DECL (mx_el_and, M1, M2, API); \
  SPARSE_BOOL_OP_DECL (mx_el_or,  M1, M2, API);

#define SPARSE_MSM_BOOL_OPS ( M1,
M2,
ZERO   )     SPARSE_MSM_BOOL_OPS2(M1, M2, ZERO, ZERO)

#define SPARSE_MSM_BOOL_OPS2 ( M1,
M2,
LHS_ZERO,
RHS_ZERO   ) 

Value:

SPARSE_MSM_BOOL_OP (mx_el_and, &&, M1, M2, LHS_ZERO, RHS_ZERO) \
  SPARSE_MSM_BOOL_OP (mx_el_or,  ||, M1, M2, LHS_ZERO, RHS_ZERO) \

#define SPARSE_MSM_CMP_OP ( F,
OP,
M1,
C1,
M2,
C2   ) 

#define SPARSE_MSM_CMP_OP_DECLS ( M1,
M2,
API   ) 

Value:

SPARSE_CMP_OP_DECL (mx_el_lt, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_le, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_ge, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_gt, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);

#define SPARSE_MSM_CMP_OPS ( M1,
Z1,
C1,
M2,
Z2,
C2   ) 

Value:

SPARSE_MSM_CMP_OP (mx_el_lt, <,  M1,   , M2,   ) \
  SPARSE_MSM_CMP_OP (mx_el_le, <=, M1,   , M2,   ) \
  SPARSE_MSM_CMP_OP (mx_el_ge, >=, M1,   , M2,   ) \
  SPARSE_MSM_CMP_OP (mx_el_gt, >,  M1,   , M2,   ) \
  SPARSE_MSM_CMP_OP (mx_el_eq, ==, M1,   , M2,   ) \
  SPARSE_MSM_CMP_OP (mx_el_ne, !=, M1,   , M2,   )

#define SPARSE_MSM_EQNE_OP_DECLS ( M1,
M2,
API   ) 

Value:

SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);

#define SPARSE_MSM_EQNE_OPS ( M1,
Z1,
C1,
M2,
Z2,
C2   ) 

Value:

SPARSE_MSM_CMP_OP (mx_el_eq, ==, M1,   , M2,   ) \
  SPARSE_MSM_CMP_OP (mx_el_ne, !=, M1,   , M2,   )

#define SPARSE_MSM_OP_DECLS ( R1,
R2,
M1,
M2,
API   ) 

Value:

SPARSE_MSM_BIN_OP_DECLS (R1, R2, M1, M2, API) \
  SPARSE_MSM_CMP_OP_DECLS (M1, M2, API) \
  SPARSE_MSM_BOOL_OP_DECLS (M1, M2, API)

#define SPARSE_REDUCTION_OP ( RET_TYPE,
EL_TYPE,
OP,
INIT_VAL,
MT_RESULT   ) 

Value:

SPARSE_BASE_REDUCTION_OP (RET_TYPE, EL_TYPE, \
                        SPARSE_REDUCTION_OP_ROW_EXPR (OP), \
                        SPARSE_REDUCTION_OP_COL_EXPR (OP), \
                        INIT_VAL, MT_RESULT)

#define SPARSE_REDUCTION_OP_COL_EXPR ( OP   )     tmp[j] OP data (i)

#define SPARSE_REDUCTION_OP_ROW_EXPR ( OP   )     tmp[ridx(i)] OP data (i)

#define SPARSE_SMM_BIN_OP_1 ( R,
F,
OP,
M1,
M2   ) 

Value:

R \
  F (const M1& m1, const M2& m2) \
  { \
    R r; \
 \
    octave_idx_type m1_nr = m1.rows (); \
    octave_idx_type m1_nc = m1.cols (); \
 \
    octave_idx_type m2_nr = m2.rows (); \
    octave_idx_type m2_nc = m2.cols (); \
 \
    if (m1_nr == 1 && m1_nc == 1) \
      r = R (m1.elem(0,0) OP m2); \
    else if (m1_nr != m2_nr || m1_nc != m2_nc) \
      gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
    else \
      { \
        r = R (m1_nr, m1_nc); \
        \
        for (octave_idx_type j = 0; j < m1_nc; j++) \
          for (octave_idx_type i = 0; i < m1_nr; i++) \
            r.elem (i, j) = m1.elem (i, j) OP m2.elem (i, j); \
      } \
    return r; \
  }

#define SPARSE_SMM_BIN_OP_2 ( R,
F,
OP,
M1,
M2,
ZERO   ) 

#define SPARSE_SMM_BIN_OP_DECLS ( R1,
R2,
M1,
M2,
API   ) 

Value:

SPARSE_BIN_OP_DECL (R1, operator +, M1, M2, API); \
  SPARSE_BIN_OP_DECL (R1, operator -, M1, M2, API); \
  SPARSE_BIN_OP_DECL (R2, product,    M1, M2, API); \
  SPARSE_BIN_OP_DECL (R2, quotient,   M1, M2, API);

#define SPARSE_SMM_BIN_OPS ( R1,
R2,
M1,
M2   ) 

Value:

SPARSE_SMM_BIN_OP_1 (R1, operator +,  +, M1, M2) \
  SPARSE_SMM_BIN_OP_1 (R1, operator -,  -, M1, M2) \
  SPARSE_SMM_BIN_OP_2 (R2, product,     *, M1, M2, 0.0) \
  SPARSE_SMM_BIN_OP_2 (R2, quotient,    /, M1, M2, 0.0)

#define SPARSE_SMM_BOOL_OP ( F,
OP,
M1,
M2,
LHS_ZERO,
RHS_ZERO   ) 

#define SPARSE_SMM_BOOL_OP_DECLS ( M1,
M2,
API   ) 

Value:

SPARSE_BOOL_OP_DECL (mx_el_and, M1, M2, API); \
  SPARSE_BOOL_OP_DECL (mx_el_or,  M1, M2, API);

#define SPARSE_SMM_BOOL_OPS ( M1,
M2,
ZERO   )     SPARSE_SMM_BOOL_OPS2(M1, M2, ZERO, ZERO)

#define SPARSE_SMM_BOOL_OPS2 ( M1,
M2,
LHS_ZERO,
RHS_ZERO   ) 

Value:

SPARSE_SMM_BOOL_OP (mx_el_and, &&, M1, M2, LHS_ZERO, RHS_ZERO) \
  SPARSE_SMM_BOOL_OP (mx_el_or,  ||, M1, M2, LHS_ZERO, RHS_ZERO) \

#define SPARSE_SMM_CMP_OP ( F,
OP,
M1,
C1,
M2,
C2   ) 

#define SPARSE_SMM_CMP_OP_DECLS ( M1,
M2,
API   ) 

Value:

SPARSE_CMP_OP_DECL (mx_el_lt, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_le, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_ge, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_gt, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);

#define SPARSE_SMM_CMP_OPS ( M1,
Z1,
C1,
M2,
Z2,
C2   ) 

Value:

SPARSE_SMM_CMP_OP (mx_el_lt, <,  M1,   , M2,   ) \
  SPARSE_SMM_CMP_OP (mx_el_le, <=, M1,   , M2,   ) \
  SPARSE_SMM_CMP_OP (mx_el_ge, >=, M1,   , M2,   ) \
  SPARSE_SMM_CMP_OP (mx_el_gt, >,  M1,   , M2,   ) \
  SPARSE_SMM_CMP_OP (mx_el_eq, ==, M1,   , M2,   ) \
  SPARSE_SMM_CMP_OP (mx_el_ne, !=, M1,   , M2,   )

#define SPARSE_SMM_EQNE_OP_DECLS ( M1,
M2,
API   ) 

Value:

SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);

#define SPARSE_SMM_EQNE_OPS ( M1,
Z1,
C1,
M2,
Z2,
C2   ) 

Value:

SPARSE_SMM_CMP_OP (mx_el_eq, ==, M1,   , M2,   ) \
  SPARSE_SMM_CMP_OP (mx_el_ne, !=, M1,   , M2,   )

#define SPARSE_SMM_OP_DECLS ( R1,
R2,
M1,
M2,
API   ) 

Value:

SPARSE_SMM_BIN_OP_DECLS (R1, R2, M1, M2, API) \
  SPARSE_SMM_CMP_OP_DECLS (M1, M2, API) \
  SPARSE_SMM_BOOL_OP_DECLS (M1, M2, API)

#define SPARSE_SMS_BIN_OP_1 ( R,
F,
OP,
M,
 ) 

Value:

R \
  F (const M& m, const S& s) \
  { \
    octave_idx_type nr = m.rows (); \
    octave_idx_type nc = m.cols (); \
 \
    R r (nr, nc, (0.0 OP s)); \
 \
    for (octave_idx_type j = 0; j < nc; j++) \
      for (octave_idx_type i = m.cidx (j); i < m.cidx (j+1); i++) \
        r.elem (m.ridx (i), j) = m.data (i) OP s; \
    return r; \
  }

#define SPARSE_SMS_BIN_OP_2 ( R,
F,
OP,
M,
 ) 

Value:

R \
  F (const M& m, const S& s) \
  { \
    octave_idx_type nr = m.rows (); \
    octave_idx_type nc = m.cols (); \
    octave_idx_type nz = m.nnz (); \
 \
    R r (nr, nc, nz); \
 \
    for (octave_idx_type i = 0; i < nz; i++) \
      { \
        r.data(i) = m.data(i) OP s; \
        r.ridx(i) = m.ridx(i); \
      } \
    for (octave_idx_type i = 0; i < nc + 1; i++) \
      r.cidx(i) = m.cidx(i); \
    \
    r.maybe_compress (true); \
    return r; \
  }

#define SPARSE_SMS_BIN_OP_DECLS ( R1,
R2,
M,
S,
API   ) 

Value:

SPARSE_BIN_OP_DECL (R1, operator +, M, S, API); \
  SPARSE_BIN_OP_DECL (R1, operator -, M, S, API); \
  SPARSE_BIN_OP_DECL (R2, operator *, M, S, API); \
  SPARSE_BIN_OP_DECL (R2, operator /, M, S, API);

#define SPARSE_SMS_BIN_OPS ( R1,
R2,
M,
 ) 

Value:

SPARSE_SMS_BIN_OP_1 (R1, operator +, +, M, S) \
  SPARSE_SMS_BIN_OP_1 (R1, operator -, -, M, S) \
  SPARSE_SMS_BIN_OP_2 (R2, operator *, *, M, S) \
  SPARSE_SMS_BIN_OP_2 (R2, operator /, /, M, S)

#define SPARSE_SMS_BOOL_OP ( F,
OP,
M,
S,
LHS_ZERO,
RHS_ZERO   ) 

#define SPARSE_SMS_BOOL_OP_DECLS ( M,
S,
API   ) 

Value:

SPARSE_BOOL_OP_DECL (mx_el_and, M, S, API); \
  SPARSE_BOOL_OP_DECL (mx_el_or,  M, S, API);

#define SPARSE_SMS_BOOL_OPS ( M,
S,
ZERO   )     SPARSE_SMS_BOOL_OPS2(M, S, ZERO, ZERO)

#define SPARSE_SMS_BOOL_OPS2 ( M,
S,
LHS_ZERO,
RHS_ZERO   ) 

Value:

SPARSE_SMS_BOOL_OP (mx_el_and, &&, M, S, LHS_ZERO, RHS_ZERO) \
  SPARSE_SMS_BOOL_OP (mx_el_or,  ||, M, S, LHS_ZERO, RHS_ZERO)

#define SPARSE_SMS_CMP_OP ( F,
OP,
M,
MZ,
MC,
S,
SZ,
SC   ) 

#define SPARSE_SMS_CMP_OP_DECLS ( M,
S,
API   ) 

Value:

SPARSE_CMP_OP_DECL (mx_el_lt, M, S, API); \
  SPARSE_CMP_OP_DECL (mx_el_le, M, S, API); \
  SPARSE_CMP_OP_DECL (mx_el_ge, M, S, API); \
  SPARSE_CMP_OP_DECL (mx_el_gt, M, S, API); \
  SPARSE_CMP_OP_DECL (mx_el_eq, M, S, API); \
  SPARSE_CMP_OP_DECL (mx_el_ne, M, S, API);

#define SPARSE_SMS_CMP_OPS ( M,
MZ,
CM,
S,
SZ,
CS   ) 

Value:

SPARSE_SMS_CMP_OP (mx_el_lt, <,  M, MZ,   , S, SZ,   )  \
  SPARSE_SMS_CMP_OP (mx_el_le, <=, M, MZ,   , S, SZ,   )        \
  SPARSE_SMS_CMP_OP (mx_el_ge, >=, M, MZ,   , S, SZ,   )        \
  SPARSE_SMS_CMP_OP (mx_el_gt, >,  M, MZ,   , S, SZ,   )        \
  SPARSE_SMS_CMP_OP (mx_el_eq, ==, M, MZ,   , S, SZ,   )        \
  SPARSE_SMS_CMP_OP (mx_el_ne, !=, M, MZ,   , S, SZ,   )

#define SPARSE_SMS_EQNE_OP_DECLS ( M,
S,
API   ) 

Value:

SPARSE_CMP_OP_DECL (mx_el_eq, M, S, API); \
  SPARSE_CMP_OP_DECL (mx_el_ne, M, S, API);

#define SPARSE_SMS_EQNE_OPS ( M,
MZ,
CM,
S,
SZ,
CS   ) 

Value:

SPARSE_SMS_CMP_OP (mx_el_eq, ==, M, MZ,   , S, SZ,   )  \
  SPARSE_SMS_CMP_OP (mx_el_ne, !=, M, MZ,   , S, SZ,   )

#define SPARSE_SMS_OP_DECLS ( R1,
R2,
M,
S,
API   ) 

Value:

#define SPARSE_SMSM_BIN_OP_1 ( R,
F,
OP,
M1,
M2   ) 

#define SPARSE_SMSM_BIN_OP_2 ( R,
F,
OP,
M1,
M2   ) 

#define SPARSE_SMSM_BIN_OP_3 ( R,
F,
OP,
M1,
M2   ) 

#define SPARSE_SMSM_BIN_OP_DECLS ( R1,
R2,
M1,
M2,
API   ) 

Value:

SPARSE_BIN_OP_DECL (R1, operator +, M1, M2, API); \
  SPARSE_BIN_OP_DECL (R1, operator -, M1, M2, API); \
  SPARSE_BIN_OP_DECL (R2, product,    M1, M2, API); \
  SPARSE_BIN_OP_DECL (R2, quotient,   M1, M2, API);

#define SPARSE_SMSM_BIN_OPS ( R1,
R2,
M1,
M2   ) 

Value:

SPARSE_SMSM_BIN_OP_1 (R1, operator +,  +, M1, M2) \
  SPARSE_SMSM_BIN_OP_1 (R1, operator -,  -, M1, M2) \
  SPARSE_SMSM_BIN_OP_2 (R2, product,     *, M1, M2) \
  SPARSE_SMSM_BIN_OP_3 (R2, quotient,    /, M1, M2)

#define SPARSE_SMSM_BOOL_OP ( F,
OP,
M1,
M2,
LHS_ZERO,
RHS_ZERO   ) 

#define SPARSE_SMSM_BOOL_OP_DECLS ( M1,
M2,
API   ) 

Value:

SPARSE_BOOL_OP_DECL (mx_el_and, M1, M2, API); \
  SPARSE_BOOL_OP_DECL (mx_el_or,  M1, M2, API);

#define SPARSE_SMSM_BOOL_OPS ( M1,
M2,
ZERO   )     SPARSE_SMSM_BOOL_OPS2(M1, M2, ZERO, ZERO)

#define SPARSE_SMSM_BOOL_OPS2 ( M1,
M2,
LHS_ZERO,
RHS_ZERO   ) 

Value:

SPARSE_SMSM_BOOL_OP (mx_el_and, &&, M1, M2, LHS_ZERO, RHS_ZERO) \
  SPARSE_SMSM_BOOL_OP (mx_el_or,  ||, M1, M2, LHS_ZERO, RHS_ZERO) \

#define SPARSE_SMSM_CMP_OP ( F,
OP,
M1,
Z1,
C1,
M2,
Z2,
C2   ) 

#define SPARSE_SMSM_CMP_OP_DECLS ( M1,
M2,
API   ) 

Value:

SPARSE_CMP_OP_DECL (mx_el_lt, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_le, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_ge, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_gt, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);

#define SPARSE_SMSM_CMP_OPS ( M1,
Z1,
C1,
M2,
Z2,
C2   ) 

Value:

SPARSE_SMSM_CMP_OP (mx_el_lt, <,  M1, Z1,   , M2, Z2,   ) \
  SPARSE_SMSM_CMP_OP (mx_el_le, <=, M1, Z1,   , M2, Z2,   ) \
  SPARSE_SMSM_CMP_OP (mx_el_ge, >=, M1, Z1,   , M2, Z2,   ) \
  SPARSE_SMSM_CMP_OP (mx_el_gt, >,  M1, Z1,   , M2, Z2,   ) \
  SPARSE_SMSM_CMP_OP (mx_el_eq, ==, M1, Z1,   , M2, Z2,   ) \
  SPARSE_SMSM_CMP_OP (mx_el_ne, !=, M1, Z1,   , M2, Z2,   )

#define SPARSE_SMSM_EQNE_OP_DECLS ( M1,
M2,
API   ) 

Value:

SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);

#define SPARSE_SMSM_EQNE_OPS ( M1,
Z1,
C1,
M2,
Z2,
C2   ) 

Value:

SPARSE_SMSM_CMP_OP (mx_el_eq, ==, M1, Z1,   , M2, Z2,   ) \
  SPARSE_SMSM_CMP_OP (mx_el_ne, !=, M1, Z1,   , M2, Z2,   )

#define SPARSE_SMSM_OP_DECLS ( R1,
R2,
M1,
M2,
API   ) 

Value:

SPARSE_SMSM_BIN_OP_DECLS (R1, R2, M1, M2, API) \
  SPARSE_SMSM_CMP_OP_DECLS (M1, M2, API) \
  SPARSE_SMSM_BOOL_OP_DECLS (M1, M2, API)

#define SPARSE_SPARSE_MUL ( RET_TYPE,
RET_EL_TYPE,
EL_TYPE   ) 

#define SPARSE_SSM_BIN_OP_1 ( R,
F,
OP,
S,
 ) 

Value:

R \
  F (const S& s, const M& m) \
  { \
    octave_idx_type nr = m.rows (); \
    octave_idx_type nc = m.cols (); \
 \
    R r (nr, nc, (s OP 0.0)); \
 \
    for (octave_idx_type j = 0; j < nc; j++) \
      for (octave_idx_type i = m.cidx (j); i < m.cidx (j+1); i++) \
        r.elem (m.ridx (i), j) = s OP m.data (i); \
 \
    return r; \
  }

#define SPARSE_SSM_BIN_OP_2 ( R,
F,
OP,
S,
 ) 

Value:

R \
  F (const S& s, const M& m) \
  { \
    octave_idx_type nr = m.rows (); \
    octave_idx_type nc = m.cols (); \
    octave_idx_type nz = m.nnz (); \
 \
    R r (nr, nc, nz); \
 \
    for (octave_idx_type i = 0; i < nz; i++) \
      { \
        r.data(i) = s OP m.data(i); \
        r.ridx(i) = m.ridx(i); \
      } \
    for (octave_idx_type i = 0; i < nc + 1; i++) \
      r.cidx(i) = m.cidx(i); \
 \
    r.maybe_compress(true); \
    return r; \
  }

#define SPARSE_SSM_BIN_OP_DECLS ( R1,
R2,
S,
M,
API   ) 

Value:

SPARSE_BIN_OP_DECL (R1, operator +, S, M, API); \
  SPARSE_BIN_OP_DECL (R1, operator -, S, M, API); \
  SPARSE_BIN_OP_DECL (R2, operator *, S, M, API); \
  SPARSE_BIN_OP_DECL (R2, operator /, S, M, API);

#define SPARSE_SSM_BIN_OPS ( R1,
R2,
S,
 ) 

Value:

SPARSE_SSM_BIN_OP_1 (R1, operator +, +, S, M) \
  SPARSE_SSM_BIN_OP_1 (R1, operator -, -, S, M) \
  SPARSE_SSM_BIN_OP_2 (R2, operator *, *, S, M) \
  SPARSE_SSM_BIN_OP_2 (R2, operator /, /, S, M)

#define SPARSE_SSM_BOOL_OP ( F,
OP,
S,
M,
LHS_ZERO,
RHS_ZERO   ) 

#define SPARSE_SSM_BOOL_OP_DECLS ( S,
M,
API   ) 

Value:

SPARSE_BOOL_OP_DECL (mx_el_and, S, M, API); \
  SPARSE_BOOL_OP_DECL (mx_el_or,  S, M, API); \

#define SPARSE_SSM_BOOL_OPS ( S,
M,
ZERO   )     SPARSE_SSM_BOOL_OPS2(S, M, ZERO, ZERO)

#define SPARSE_SSM_BOOL_OPS2 ( S,
M,
LHS_ZERO,
RHS_ZERO   ) 

Value:

SPARSE_SSM_BOOL_OP (mx_el_and, &&, S, M, LHS_ZERO, RHS_ZERO) \
  SPARSE_SSM_BOOL_OP (mx_el_or,  ||, S, M, LHS_ZERO, RHS_ZERO)

#define SPARSE_SSM_CMP_OP ( F,
OP,
S,
SZ,
SC,
M,
MZ,
MC   ) 

#define SPARSE_SSM_CMP_OP_DECLS ( S,
M,
API   ) 

Value:

SPARSE_CMP_OP_DECL (mx_el_lt, S, M, API); \
  SPARSE_CMP_OP_DECL (mx_el_le, S, M, API); \
  SPARSE_CMP_OP_DECL (mx_el_ge, S, M, API); \
  SPARSE_CMP_OP_DECL (mx_el_gt, S, M, API); \
  SPARSE_CMP_OP_DECL (mx_el_eq, S, M, API); \
  SPARSE_CMP_OP_DECL (mx_el_ne, S, M, API);

#define SPARSE_SSM_CMP_OPS ( S,
SZ,
SC,
M,
MZ,
MC   ) 

Value:

SPARSE_SSM_CMP_OP (mx_el_lt, <,  S, SZ,   , M, MZ,   )  \
  SPARSE_SSM_CMP_OP (mx_el_le, <=, S, SZ,   , M, MZ,   )        \
  SPARSE_SSM_CMP_OP (mx_el_ge, >=, S, SZ,   , M, MZ,   )        \
  SPARSE_SSM_CMP_OP (mx_el_gt, >,  S, SZ,   , M, MZ,   )        \
  SPARSE_SSM_CMP_OP (mx_el_eq, ==, S, SZ,   , M, MZ,   )        \
  SPARSE_SSM_CMP_OP (mx_el_ne, !=, S, SZ,   , M, MZ,   )

#define SPARSE_SSM_EQNE_OP_DECLS ( S,
M,
API   ) 

Value:

SPARSE_CMP_OP_DECL (mx_el_eq, S, M, API); \
  SPARSE_CMP_OP_DECL (mx_el_ne, S, M, API);

#define SPARSE_SSM_EQNE_OPS ( S,
SZ,
SC,
M,
MZ,
MC   ) 

Value:

SPARSE_SSM_CMP_OP (mx_el_eq, ==, S, SZ,   , M, MZ,   )  \
  SPARSE_SSM_CMP_OP (mx_el_ne, !=, S, SZ,   , M, MZ,   )

#define SPARSE_SSM_OP_DECLS ( R1,
R2,
S,
M,
API   ) 

Value: