8 #ifndef SCAMAC_VECTOR_H 9 #define SCAMAC_VECTOR_H 18 typedef struct scamac_vector_st ScamacVector;
19 typedef struct scamac_vectormem_st ScamacVectorMem;
23 ScamacErrorCode scamac_vecmat_init();
26 ScamacErrorCode scamac_vecmat_finalize();
48 ScamacErrorCode scamac_vector_view_range (ScamacVectorMem * vm,
int ia,
int ib, ScamacVector ** v);
49 ScamacErrorCode scamac_vector_view_mask (ScamacVectorMem * vm,
const bool *mask, ScamacVector ** v);
56 ScamacInt scamac_vector_query_nv (
const ScamacVector * v);
57 int scamac_vector_query_m (
const ScamacVector * v);
59 ScamacValType scamac_vector_query_valtype(
const ScamacVector * v);
70 ScamacErrorCode scamac_vector_sub_range (
const ScamacVector * v,
int ia,
int ib, ScamacVector ** w);
71 ScamacErrorCode scamac_vector_sub_mask (
const ScamacVector * v,
const bool *mask, ScamacVector ** w);
82 ScamacErrorCode scamac_vector_align_front(ScamacVector * v);
88 ScamacErrorCode scamac_vector_zero (ScamacVector * v);
90 ScamacErrorCode scamac_vector_random(
const char * seed,
bool use_entropy,
bool normalize, ScamacVector * v);
109 ScamacErrorCode
scamac_vector_dot (
const ScamacVector * v1,
const ScamacVector * v2,
double * dot);
110 ScamacErrorCode scamac_vector_zdot(
const ScamacVector * v1,
const ScamacVector * v2,
double complex * zdot);
124 ScamacErrorCode scamac_vector_zdotmatrix(
const ScamacVector * v1,
const ScamacVector * v2,
double complex * zdotm);
137 ScamacErrorCode scamac_vector_zgram(
const ScamacVector * v,
double complex * zgram);
143 ScamacErrorCode
scamac_mvector_axpby (
const ScamacVector * x, ScamacVector * y,
const double *a,
const double *b);
144 ScamacErrorCode scamac_mvector_zaxpby(
const ScamacVector * x, ScamacVector * y,
const double complex *a,
const double complex *b);
145 ScamacErrorCode scamac_svector_axpby (
const ScamacVector * x, ScamacVector * y,
double a,
double b);
146 ScamacErrorCode scamac_svector_zaxpby(
const ScamacVector * x, ScamacVector * y,
double complex a,
double complex b);
152 ScamacErrorCode scamac_mvector_zscal(ScamacVector * x,
const double complex * s);
153 ScamacErrorCode scamac_svector_scal (ScamacVector * x,
double s);
154 ScamacErrorCode scamac_svector_zscal(ScamacVector * x,
double complex s);
163 ScamacErrorCode scamac_vector_ztransform(
const ScamacVector * x,
const double complex * a, ScamacVector * y);
181 ScamacErrorCode scamac_vector_zorthogonalize(
const ScamacVector * v, ScamacVector * w,
double complex * r,
int * p);
184 ScamacErrorCode scamac_vector_check_orthogonality(
const ScamacVector * v,
double * err,
double * errnrm,
double * errperp);
187 ScamacErrorCode scamac_vector_print(
const ScamacVector * v);
192 bool scamac_vectormem_check(
const ScamacVectorMem * vm);
193 bool scamac_vector_check(
const ScamacVector * v);
194 bool scamac_vector_check_compatibility(
const ScamacVector * v1,
const ScamacVector * v2);
195 bool scamac_vector_check_compatible_columns(
const ScamacVector * v1,
const ScamacVector * v2);
196 bool scamac_vector_check_exclusivity (
const ScamacVector * v1,
const ScamacVector * v2);
197 bool scamac_vector_check_aligned (
const ScamacVector * v);
198 void * scamac_vector_getptr(
const ScamacVector * v, ScamacInt i);
ScamacErrorCode scamac_vector_align(ScamacVector *v)
ScaMaC index/integer types.
ScamacErrorCode scamac_vectormem_free(ScamacVectorMem *v)
ScamacErrorCode scamac_vectormem_alloc(ScamacInt nv, int m, ScamacValType valtype, ScamacVectorMem **v)
Allocate vector(s)equivalent to calling scamac_vector_multiple_alloc with m=1.
ScamacErrorCode scamac_vector_copy(const ScamacVector *v, ScamacVector *w)
ScamacErrorCode scamac_vector_dot(const ScamacVector *v1, const ScamacVector *v2, double *dot)
ScamacErrorCode scamac_vector_dotmatrix(const ScamacVector *v1, const ScamacVector *v2, double *dotm)
ScamacErrorCode scamac_vector_complement(const ScamacVector *v, ScamacVector **w)
ScamacErrorCode scamac_mvector_scal(ScamacVector *x, const double *s)
ScamacErrorCode scamac_vector_sub_single(const ScamacVector *v, int i, ScamacVector **w)
ScamacErrorCode scamac_mvector_axpby(const ScamacVector *x, ScamacVector *y, const double *a, const double *b)
ScamacErrorCode scamac_vector_transform(const ScamacVector *x, const double *a, ScamacVector *y)
ScamacErrorCode scamac_vector_free(ScamacVector *v)
ScamacErrorCode scamac_vector_assign(const char *which, ScamacVector *v)
ScamacErrorCode scamac_vector_view_single(ScamacVectorMem *vm, int i, ScamacVector **v)
ScaMaC data structure and macro definitions.
ScamacErrorCode scamac_vector_gram(const ScamacVector *v, double *gram)
ScamacErrorCode scamac_vector_orthogonalize(const ScamacVector *v, ScamacVector *w, double *r, int *p)
ScamacErrorCode scamac_vector_nrm2(const ScamacVector *v, double *nrm)
ScamacErrorCode scamac_vector_view(ScamacVectorMem *vm, ScamacVector **v)