STARS-H
Software for Testing Accuracy, Reliability and Scalability of Hierarchical computations
starsh.h
Go to the documentation of this file.
1 
13 #ifndef __STARSH_H__
14 #define __STARSH_H__
15 
16 // Add definitions for size_t and ssize_t.
17 #include <sys/types.h>
18 
19 // Add definition for va_args.
20 #include <stdarg.h>
21 
22 // Add definitions for enumerated constants.
23 #include "starsh-constants.h"
24 
25 
27 // ENVIRONMENT //
29 
33 // This will automatically include all entities between @{ and @} into group.
35 
38 {
45 };
46 
48 extern struct starsh_params starsh_params;
49 
50 int starsh_init();
51 int starsh_set_backend(const char *string);
52 int starsh_set_lrengine(const char *string);
53 int starsh_set_oversample(const char *string);
54 
56 // End of group
57 
58 
60 // TYPEDEF //
62 
64 typedef ssize_t STARSH_int;
65 
68 typedef void STARSH_kernel(int nrows, int ncols, STARSH_int *irow,
69  STARSH_int *icol, void *row_data, void *col_data, void *result,
70  int ld);
71 
74 typedef struct array Array;
75 
79 
83 
86 typedef struct starsh_blrf STARSH_blrf;
87 
90 typedef struct starsh_blrm STARSH_blrm;
91 
92 
94 // APPLICATIONS //
96 
100 // This will automatically include all entities between @{ and @} into group.
102 
103 int starsh_application(void **data, STARSH_kernel **kernel, STARSH_int count,
104  char dtype, int problem_type, int kernel_type, ...);
105 
107 // End of group
108 
109 
111 // ARRAY //
113 
117 // This will automatically include all entities between @{ and @} into group.
119 
120 struct array
122 
124 {
125  int ndim;
127  int *shape;
129  ssize_t *stride;
131  char order;
133 
136  size_t size;
138  char dtype;
140 
143  size_t dtype_size;
145  size_t nbytes;
147  size_t data_nbytes;
149  void *data;
151 };
152 
153 int array_from_buffer(Array **A, int ndim, int *shape, char dtype, char order,
154  void *buffer);
155 int array_new(Array **A, int ndim, int *shape, char dtype, char order);
156 int array_new_like(Array **A, Array *B);
157 int array_new_copy(Array **A, Array *B, char order);
158 void array_free(Array *A);
159 void array_info(Array *A);
160 void array_print(Array *A);
161 int array_to_matrix(Array *A, char kind);
162 int array_trans_inplace(Array *A);
163 int array_dot(Array* A, Array *B, Array **C);
164 int array_SVD(Array *A, Array **U, Array **S, Array **V);
165 int SVD_get_rank(Array *S, double tol, char type, int *rank);
166 int array_scale(Array *A, char kind, Array *S);
167 int array_diff(Array *A, Array *B, double *result);
168 int array_norm(Array *A, double *result);
169 int array_convert(Array **A, Array *B, char dtype);
170 int array_cholesky(Array *A, char uplo);
171 
173 // End of group
174 
175 
177 // PROBLEM //
179 
183 // This will automatically include all entities between @{ and @} into group.
185 
188 
195 {
196  int ndim;
198 
204 
209  char symm;
211  char dtype;
213 
216  size_t dtype_size;
218  size_t entry_size;
220 
225  void *row_data;
227  void *col_data;
231 
235  char *name;
237 };
238 
239 int starsh_problem_new(STARSH_problem **problem, int ndim, STARSH_int *shape,
240  char symm, char dtype, void *row_data, void *col_data,
241  STARSH_kernel *kernel, char *name);
242 void starsh_problem_free(STARSH_problem *problem);
243 void starsh_problem_info(STARSH_problem *problem);
244 int starsh_problem_get_block(STARSH_problem *problem, int nrows, int ncols,
245  STARSH_int *irow, STARSH_int *icol, Array **A);
246 int starsh_problem_from_array(STARSH_problem **problem, Array *A, char symm);
247 int starsh_problem_to_array(STARSH_problem *problem, Array **A);
248 
250 // End of group
251 
252 
254 // CLUSTER //
256 
260 // This will automatically include all entities between @{ and @} into group.
262 
265 {
266  void *data;
270 
275 
282 
286 
294 
301 
305 
312 
319 };
320 
321 int starsh_cluster_new(STARSH_cluster **cluster, void *data, STARSH_int ndata,
322  STARSH_int *pivot, STARSH_int nblocks, STARSH_int nlevels,
323  STARSH_int *level, STARSH_int *start, STARSH_int *size,
324  STARSH_int *parent, STARSH_int *child_start, STARSH_int *child,
325  enum STARSH_CLUSTER_TYPE type);
326 void starsh_cluster_free(STARSH_cluster *cluster);
327 void starsh_cluster_info(STARSH_cluster *cluster);
328 int starsh_cluster_new_plain(STARSH_cluster **cluster, void *data,
329  STARSH_int ndata, STARSH_int block_size);
330 
332 // End of group
333 
334 
336 // H-FORMAT //
338 
342 // This will automatically include all entities between @{ and @} into group.
344 
347 
371 {
374  char symm;
388 
393 
399 
405 
411 
421 
424 
429 
435 
441 
447 
457 };
458 
459 int starsh_blrf_new(STARSH_blrf **format, STARSH_problem *problem, char symm,
460  STARSH_cluster *row_cluster, STARSH_cluster *col_cluster,
461  STARSH_int nbrows, STARSH_int nbcols, STARSH_int nblocks_far,
462  STARSH_int *block_far, STARSH_int *brow_far_start,
463  STARSH_int *brow_far, STARSH_int *bcol_far_start,
464  STARSH_int *bcol_far, STARSH_int nblocks_far_local,
465  STARSH_int *block_far_local, STARSH_int nblocks_near,
466  STARSH_int *block_near, STARSH_int *brow_near_start,
467  STARSH_int *brow_near, STARSH_int *bcol_near_start,
468  STARSH_int *bcol_near, STARSH_int nblocks_near_local,
469  STARSH_int *block_near_local, enum STARSH_BLRF_TYPE type);
471  char symm, STARSH_cluster *row_cluster, STARSH_cluster *col_cluster,
472  STARSH_int nblocks_far, STARSH_int *block_far,
473  STARSH_int nblocks_near, STARSH_int *block_near,
474  enum STARSH_BLRF_TYPE type);
475 int starsh_blrf_new_tlr(STARSH_blrf **format, STARSH_problem *problem,
476  char symm, STARSH_cluster *row_cluster, STARSH_cluster *col_cluster);
477 void starsh_blrf_free(STARSH_blrf *format);
478 void starsh_blrf_info(STARSH_blrf *format);
479 void starsh_blrf_print(STARSH_blrf *format);
481  int *shape, void **D);
482 
484 // End of group
485 
486 
488 // H-MATRIX //
490 
494 // This will automatically include all entities between @{ and @} into group.
496 
499 
502 {
505  int *far_rank;
509 
514 
517  int onfly;
521  void *alloc_U;
523  void *alloc_V;
525  void *alloc_D;
529 
533  size_t nbytes;
535  size_t data_nbytes;
537 };
538 
539 int starsh_blrm_new(STARSH_blrm **matrix, STARSH_blrf *format, int *far_rank,
540  Array **far_U, Array **far_V, int onfly, Array **near_D, void *alloc_U,
541  void *alloc_V, void *alloc_D, char alloc_type);
542 void starsh_blrm_free(STARSH_blrm *matrix);
543 void starsh_blrm_info(STARSH_blrm *matrix);
545  int *shape, int *rank, void **U, void **V, void **D);
546 
548 // End of group
549 
550 
552 // APPROXIMATIONS //
554 
559 // This will automatically include all entities between @{ and @} into group.
561 
563 typedef int STARSH_blrm_approximate(STARSH_blrm **matrix, STARSH_blrf *format,
564  int maxrank, double tol, int onfly);
568 
569 int starsh_blrm__dsdd(STARSH_blrm **matrix, STARSH_blrf *format, int maxrank,
570  double tol, int onfly);
571 int starsh_blrm__drsdd(STARSH_blrm **matrix, STARSH_blrf *format, int maxrank,
572  double tol, int onfly);
573 int starsh_blrm__dqp3(STARSH_blrm **matrix, STARSH_blrf *format, int maxrank,
574  double tol, int onfly);
575 //int starsh_blrm__dna(STARSH_blrm **matrix, STARSH_blrf *format, int maxrank,
576 // double tol, int onfly);
577 
578 int starsh_blrm__dsdd_omp(STARSH_blrm **matrix, STARSH_blrf *format,
579  int maxrank, double tol, int onfly);
580 int starsh_blrm__drsdd_omp(STARSH_blrm **matrix, STARSH_blrf *format,
581  int maxrank, double tol, int onfly);
582 int starsh_blrm__dqp3_omp(STARSH_blrm **matrix, STARSH_blrf *format,
583  int maxrank, double tol, int onfly);
584 //int starsh_blrm__dna_omp(STARSH_blrm **matrix, STARSH_blrf *format,
585 // int maxrank, double tol, int onfly);
586 
588 // End of group
589 
590 
592 // MATRIX-MATRIX MULTIPLICATION //
594 
599 // This will automatically include all entities between @{ and @} into group.
601 
602 int starsh_blrm__dmml(STARSH_blrm *matrix, int nrhs, double alpha,
603  double *A, int lda, double beta, double *B, int ldb);
604 int starsh_blrm__dmml_omp(STARSH_blrm *matrix, int nrhs, double alpha,
605  double *A, int lda, double beta, double *B, int ldb);
606 
608 // End of group
609 
610 
612 // MEASURE APPROXIMATION ERROR //
614 
619 // This will automatically include all entities between @{ and @} into group.
621 
622 double starsh_blrm__dfe(STARSH_blrm *matrix);
623 double starsh_blrm__dfe_omp(STARSH_blrm *matrix);
624 
625 // This function should not be in this group, but it is for now.
626 int starsh_blrm__dca(STARSH_blrm *matrix, Array *A);
627 
629 // End of group
630 
631 
633 // LOW-RANK ROUTINES FOR DENSE //
635 
639 // This will automatically include all entities between @{ and @} into group.
641 
642 int starsh_dense_dsvfr(int size, double *S, double tol);
643 
644 void starsh_dense_dlrsdd(int nrows, int ncols, double *D, int ldD, double *U,
645  int ldU, double *V, int ldV, int *rank, int maxrank, double tol,
646  double *work, int lwork, int *iwork);
647 void starsh_dense_dlrrsdd(int nrows, int ncols, double *D, int ldD, double *U,
648  int ldU, double *V, int ldV, int *rank, int maxrank, int oversample,
649  double tol, double *work, int lwork, int *iwork);
650 void starsh_dense_dlrqp3(int nrows, int ncols, double *D, int ldD, double *U,
651  int ldU, double *V, int ldV, int *rank, int maxrank, int oversample,
652  double tol, double *work, int lwork, int *iwork);
653 void starsh_dense_dlrna(int nrows, int ncols, double *D, double *U, double *V,
654  int *rank, int maxrank, double tol, double *work, int lwork,
655  int *iwork);
656 
658 // End of group
659 
660 
662 // ITERATIVE SOLVERS //
664 
668 // This will automatically include all entities between @{ and @} into group.
670 
671 int starsh_itersolvers__dcg_omp(STARSH_blrm *matrix, int nrhs, double *B,
672  int ldb, double *X, int ldx, double tol, double *work);
673 
675 // End of group
676 
677 
679 // HEADERS FOR OTHER BACKENDS //
681 
682 // This headers should be at the end, since all Doxygen groups must be defined
683 // before (and they are defined above).
684 #include "starsh-mpi.h"
685 #include "starsh-starpu.h"
686 #include "starsh-mpi-starpu.h"
687 
688 
689 #endif // __STARSH_H__
690 
STARSH_int nblocks_far
Number of admissible far-field blocks.
Definition: starsh.h:384
int starsh_blrm__drsdd_omp(STARSH_blrm **matrix, STARSH_blrf *format, int maxrank, double tol, int onfly)
Approximate each tile by randomized SVD.
Definition: drsdd.c:16
Array ** far_V
Low rank factor of each far-field block.
Definition: starsh.h:512
ssize_t STARSH_int
STARSH signed integer to support more, than MAX_INT rows/columns.
Definition: starsh.h:64
int starsh_blrm_get_block(STARSH_blrm *matrix, STARSH_int i, STARSH_int j, int *shape, int *rank, void **U, void **V, void **D)
Get shape, rank and low-rank factors or dense representation of a block.
Definition: blrm.c:200
STARSH_kernel * kernel
Pointer to a kernel.
Definition: starsh.h:229
STARSH_blrf * format
Pointer to block low-rank format.
Definition: starsh.h:503
Array ** far_U
Low rank factor of each far-field block.
Definition: starsh.h:507
STARSH_int * level
Index of first cluster for each level of hierarchy.
Definition: starsh.h:284
STARSH_int nblocks_far_local
Number of far-field blocks, stored locally on MPI node.
Definition: starsh.h:415
int starsh_blrf_new_from_coo(STARSH_blrf **format, STARSH_problem *problem, char symm, STARSH_cluster *row_cluster, STARSH_cluster *col_cluster, STARSH_int nblocks_far, STARSH_int *block_far, STARSH_int nblocks_near, STARSH_int *block_near, enum STARSH_BLRF_TYPE type)
Init STARSH_blrf object by lists of admissible blocks.
Definition: blrf.c:90
STARSH_problem * problem
Corresponding problem.
Definition: starsh.h:372
void starsh_cluster_free(STARSH_cluster *cluster)
Definition: cluster.c:70
enum STARSH_BACKEND backend
What backend to use (e.g. MPI or STARPU).
Definition: starsh.h:39
int starsh_problem_new(STARSH_problem **problem, int ndim, STARSH_int *shape, char symm, char dtype, void *row_data, void *col_data, STARSH_kernel *kernel, char *name)
Init STARSH_problem object.
Definition: problem.c:16
int starsh_cluster_new_plain(STARSH_cluster **cluster, void *data, STARSH_int ndata, STARSH_int block_size)
Plain division of data into blocks of discrete elements.
Definition: cluster.c:106
void * data
Pointer to data buffer.
Definition: starsh.h:149
int array_dot(Array *A, Array *B, Array **C)
GEMM for A and B into C.
Definition: array.c:488
void starsh_cluster_info(STARSH_cluster *cluster)
Definition: cluster.c:91
int array_norm(Array *A, double *result)
Measure Frobenius norm of A.
Definition: array.c:908
void starsh_blrm_free(STARSH_blrm *matrix)
Definition: blrm.c:130
int onfly
Equal to 1 to store dense blocks, 0 to compute it on demand.
Definition: starsh.h:517
int starsh_blrf_new_tlr(STARSH_blrf **format, STARSH_problem *problem, char symm, STARSH_cluster *row_cluster, STARSH_cluster *col_cluster)
TLR partitioning of problem with given plain clusters.
Definition: blrf.c:291
void * col_data
Pointer to data, corresponding to columns.
Definition: starsh.h:227
enum STARSH_BLRF_TYPE type
Type of format.
Definition: starsh.h:455
STARSH_int * start
Index of first pivoted discrete element of a cluster.
Definition: starsh.h:292
enum STARSH_CLUSTER_TYPE type
Type of cluster (tiled or hierarchical).
Definition: starsh.h:317
STARSH_int * brow_far_start
Start indexes of admissibly far block columns for each block row.
Definition: starsh.h:391
size_t dtype_size
Size of element of array in bytes.
Definition: starsh.h:216
int oversample
Oversampling parameter for RSVD and RRQR.
Definition: starsh.h:43
STARSH_BLRF_TYPE
Enum type to show actual block low-rank format.
Definition: starsh-constants.h:101
STARSH_int nblocks_near
Number of admissible near-field blocks.
Definition: starsh.h:419
void array_print(Array *A)
Definition: array.c:289
void * row_data
Pointer to data, corresponding to rows.
Definition: starsh.h:225
#define ndim
Replace variable ndim with static integer value.
Definition: kernel_sin_1d.c:28
int starsh_blrf_new(STARSH_blrf **format, STARSH_problem *problem, char symm, STARSH_cluster *row_cluster, STARSH_cluster *col_cluster, STARSH_int nbrows, STARSH_int nbcols, STARSH_int nblocks_far, STARSH_int *block_far, STARSH_int *brow_far_start, STARSH_int *brow_far, STARSH_int *bcol_far_start, STARSH_int *bcol_far, STARSH_int nblocks_far_local, STARSH_int *block_far_local, STARSH_int nblocks_near, STARSH_int *block_near, STARSH_int *brow_near_start, STARSH_int *brow_near, STARSH_int *bcol_near_start, STARSH_int *bcol_near, STARSH_int nblocks_near_local, STARSH_int *block_near_local, enum STARSH_BLRF_TYPE type)
Init STARSH_blrf object.
Definition: blrf.c:17
void starsh_blrf_free(STARSH_blrf *format)
Definition: blrf.c:373
STARSH_int nlevels
Number of levels of hierarchy.
Definition: starsh.h:280
STARSH_BACKEND
Enum for backend types.
Definition: starsh-constants.h:17
int starsh_itersolvers__dcg_omp(STARSH_blrm *matrix, int nrhs, double *B, int ldb, double *X, int ldx, double tol, double *work)
Conjugate gradient method for STARSH_blrm object.
Definition: cg.c:24
STARSH_int nbrows
Number of block rows (clusters of rows).
Definition: starsh.h:380
int * shape
Shape of array.
Definition: starsh.h:127
void * data
Pointer to structure, holding physical data.
Definition: starsh.h:266
int starsh_problem_get_block(STARSH_problem *problem, int nrows, int ncols, STARSH_int *irow, STARSH_int *icol, Array **A)
Get submatrix on given rows and columns.
Definition: problem.c:130
int STARSH_blrm_approximate(STARSH_blrm **matrix, STARSH_blrf *format, int maxrank, double tol, int onfly)
Typedef for prototype of approximation routine.
Definition: starsh.h:563
STARSH_int * block_far
Coordinates of far-field admissible blocks.
Definition: starsh.h:386
Structure for built-in STARS-H parameters.
Definition: starsh.h:37
STARSH_int * bcol_far
List of admissibly far block rows for each block column.
Definition: starsh.h:409
STARSH_int * shape
Shape of corresponding array.
Definition: starsh.h:202
void array_free(Array *A)
Definition: array.c:248
int starsh_blrf_get_block(STARSH_blrf *format, STARSH_int i, STARSH_int j, int *shape, void **D)
Returns dense block on intersection of given block row and column.
Definition: blrf.c:471
size_t data_nbytes
Size of low-rank factors and dense blocks in block low-rank matrix.
Definition: starsh.h:535
char dtype
Precision of problem and corresponding array.
Definition: starsh.h:211
size_t data_nbytes
Size of data buffer in bytes.
Definition: starsh.h:147
char symm
&#39;S&#39; if format is symmetric and &#39;N&#39; otherwise.
Definition: starsh.h:374
int array_diff(Array *A, Array *B, double *result)
Measure Frobenius error of approximation of A by B.
Definition: array.c:818
STARSH_int * block_far_local
List of far-field blocks, stored locally on MPI node.
Definition: starsh.h:417
int starsh_blrm__dmml(STARSH_blrm *matrix, int nrhs, double alpha, double *A, int lda, double beta, double *B, int ldb)
Multiply blr-matrix by dense matrix.
Definition: dmml.c:16
int array_new_like(Array **A, Array *B)
Init new array object with the shape, dtype and order of other.
Definition: array.c:145
int array_scale(Array *A, char kind, Array *S)
Apply row or column scaling to A.
Definition: array.c:752
Non-nested block-wise low-rank format.
Definition: starsh.h:345
char alloc_type
Type of memory allocation.
Definition: starsh.h:527
void array_info(Array *A)
Definition: array.c:263
int starsh_init()
Initialize backend and low-rank engine to be used.
Definition: init.c:26
int starsh_blrm__dsdd(STARSH_blrm **matrix, STARSH_blrf *format, int maxrank, double tol, int onfly)
Approximate each tile by divide-and-conquer SVD (GESDD function).
Definition: dsdd.c:16
STARSH_cluster * row_cluster
Clusterization of rows into subclusters (block rows).
Definition: starsh.h:376
void * alloc_U
Pointer to memory buffer, holding all far_U.
Definition: starsh.h:521
STARSH_int * child
Children clusters of each cluster.
Definition: starsh.h:310
int array_new(Array **A, int ndim, int *shape, char dtype, char order)
Init array object and allocate memory for its buffer.
Definition: array.c:119
Info about clusterization of physical data.
Definition: starsh.h:263
Matrix/tensor in matrix/tensor-free form.
Definition: starsh.h:186
int starsh_cluster_new(STARSH_cluster **cluster, void *data, STARSH_int ndata, STARSH_int *pivot, STARSH_int nblocks, STARSH_int nlevels, STARSH_int *level, STARSH_int *start, STARSH_int *size, STARSH_int *parent, STARSH_int *child_start, STARSH_int *child, enum STARSH_CLUSTER_TYPE type)
Init STARSH_cluster object.
Definition: cluster.c:16
size_t nbytes
Total size of block low-rank matrix, including auxiliary buffers.
Definition: starsh.h:533
STARSH_int * block_near_local
List of near-field blocks, stored locally on MPI node.
Definition: starsh.h:453
STARSH_int * parent
Parent cluster for each subcluster.
Definition: starsh.h:299
N-dimensional array.
Definition: starsh.h:120
STARSH_int * brow_near_start
Start indexes of admissibly near block colums for each block row.
Definition: starsh.h:427
STARSH_int nblocks
Total number of subclusters (blocks) of discrete elements.
Definition: starsh.h:278
void starsh_dense_dlrsdd(int nrows, int ncols, double *D, int ldD, double *U, int ldU, double *V, int ldV, int *rank, int maxrank, double tol, double *work, int lwork, int *iwork)
SVD approximation of a dense double precision matrix.
Definition: dsdd.c:16
int array_convert(Array **A, Array *B, char dtype)
Create A as a copy of B with different data type (precision).
Definition: array.c:945
size_t entry_size
Size of subarray, corresponding to kernel shape, in bytes.
Definition: starsh.h:218
int starsh_blrm__dmml_omp(STARSH_blrm *matrix, int nrhs, double alpha, double *A, int lda, double beta, double *B, int ldb)
Multiply blr-matrix by dense matrix.
Definition: dmml.c:16
double starsh_blrm__dfe(STARSH_blrm *matrix)
Approximation error in Frobenius norm of double precision matrix.
Definition: dfe.c:16
int starsh_dense_dsvfr(int size, double *S, double tol)
Returns rank of double precision singular values.
Definition: dsvfr.c:16
size_t size
Number of elements of array.
Definition: starsh.h:136
STARSH_int * brow_near
List of admissibly near block columns for each block row.
Definition: starsh.h:433
int array_new_copy(Array **A, Array *B, char order)
Init new array object as copy of other with given data layout.
Definition: array.c:180
int array_cholesky(Array *A, char uplo)
Cholesky factorization for A.
Definition: array.c:1128
int starsh_set_lrengine(const char *string)
Set low-rank engine (SVD, Randomized SVD or Cross) for computations.
Definition: init.c:111
void STARSH_kernel(int nrows, int ncols, STARSH_int *irow, STARSH_int *icol, void *row_data, void *col_data, void *result, int ld)
Definition: starsh.h:68
int starsh_problem_from_array(STARSH_problem **problem, Array *A, char symm)
Create STARSH_problem instance, based on dense array.
Definition: problem.c:227
int array_from_buffer(Array **A, int ndim, int *shape, char dtype, char order, void *data)
Init array from given buffer.
Definition: array.c:16
STARSH_int * child_start
Start index of child for each cluster.
Definition: starsh.h:303
int SVD_get_rank(Array *S, double tol, char type, int *rank)
Returns rank by given singular values S, tolerance and type of norm.
Definition: array.c:666
Array ** near_D
Array of pointers to dense near-field blocks.
Definition: starsh.h:519
STARSH_int * size
Number of discrete elements in each cluster.
Definition: starsh.h:297
void starsh_problem_info(STARSH_problem *problem)
Definition: problem.c:116
void * alloc_V
Pointer to memory buffer, holding all far_V.
Definition: starsh.h:523
int array_trans_inplace(Array *A)
Transpose A by changing shape, stride and order.
Definition: array.c:458
int starsh_set_backend(const char *string)
Set backend (MPI or OpenMP or other scheduler) for computations.
Definition: init.c:69
int starsh_blrm__drsdd(STARSH_blrm **matrix, STARSH_blrf *format, int maxrank, double tol, int onfly)
Approximate each tile by randomized SVD.
Definition: drsdd.c:16
void * alloc_D
Pointer to memory buffer, holding all near_D.
Definition: starsh.h:525
double starsh_blrm__dfe_omp(STARSH_blrm *matrix)
Approximation error in Frobenius norm of double precision matrix.
Definition: dfe.c:16
size_t dtype_size
Size of one element of array in bytes.
Definition: starsh.h:143
STARSH_int nbcols
Number of block columns (clusters of columns).
Definition: starsh.h:382
void starsh_blrf_print(STARSH_blrf *format)
Definition: blrf.c:422
STARSH_int nblocks_near_local
Number of near-field blocks, stored locally on MPI node.
Definition: starsh.h:451
void starsh_dense_dlrrsdd(int nrows, int ncols, double *D, int ldD, double *U, int ldU, double *V, int ldV, int *rank, int maxrank, int oversample, double tol, double *work, int lwork, int *iwork)
Randomized SVD approximation of a dense double precision matrix.
Definition: drsdd.c:16
char * name
Name of corresponding problem.
Definition: starsh.h:235
int ndim
Number of dimensions of array.
Definition: starsh.h:125
int array_to_matrix(Array *A, char kind)
Definition: array.c:408
STARSH_int * pivot
Pivoting of discrete elements for clusterization.
Definition: starsh.h:273
STARSH_LRENGINE
Enum for low-rank engine (approximation technique)
Definition: starsh-constants.h:44
char dtype
Precision of array.
Definition: starsh.h:138
ssize_t * stride
Strides of array.
Definition: starsh.h:129
STARSH_int * bcol_far_start
Start indexes of admissibly far block rows for each block column.
Definition: starsh.h:403
STARSH_blrm_approximate * starsh_blrm_approximate
Definition: init.c:24
STARSH_CLUSTER_TYPE
Enum type to show type of clusterization.
Definition: starsh-constants.h:112
void starsh_problem_free(STARSH_problem *problem)
Definition: problem.c:104
char order
Ordering of array.
Definition: starsh.h:131
void starsh_dense_dlrqp3(int nrows, int ncols, double *D, int ldD, double *U, int ldU, double *V, int ldV, int *rank, int maxrank, int oversample, double tol, double *work, int lwork, int *iwork)
Rank-revealing QR approximation of a dense double precision matrix.
Definition: dqp3.c:16
int starsh_set_oversample(const char *string)
Set oversampling size for randomized SVD and RRQR.
Definition: init.c:149
int starsh_problem_to_array(STARSH_problem *problem, Array **A)
Generate dense array by a given problem.
Definition: problem.c:279
int array_SVD(Array *A, Array **U, Array **S, Array **V)
Compute SVD of a given 2-dimensional A.
Definition: array.c:579
int ndim
Number of dimensions of corresponding problem.
Definition: starsh.h:196
STARSH_int ndata
Number of discrete elements, corresponding to physical data.
Definition: starsh.h:268
int starsh_blrm_new(STARSH_blrm **matrix, STARSH_blrf *format, int *far_rank, Array **far_U, Array **far_V, int onfly, Array **near_D, void *alloc_U, void *alloc_V, void *alloc_D, char alloc_type)
Init STARSH_blrm object.
Definition: blrm.c:17
void starsh_blrf_info(STARSH_blrf *format)
Definition: blrf.c:407
int starsh_blrm__dqp3(STARSH_blrm **matrix, STARSH_blrf *format, int maxrank, double tol, int onfly)
Approximate each tile of BLR matrix with RRQR (GEQP3 function).
Definition: dqp3.c:16
void starsh_dense_dlrna(int nrows, int ncols, double *D, double *U, double *V, int *rank, int maxrank, double tol, double *work, int lwork, int *iwork)
Fake approximation schemes, that returns rank=-1.
Definition: dna.c:16
Non-nested block low-rank matrix.
Definition: starsh.h:497
STARSH_int * bcol_near_start
Start indexes of admissibly near block rows for each block column.
Definition: starsh.h:439
enum STARSH_LRENGINE lrengine
What low-rank engine to use (e.g. RSVD).
Definition: starsh.h:41
size_t nbytes
Size of data buffer and array structure together in bytes.
Definition: starsh.h:145
STARSH_int * bcol_near
List of admissibly near block rows for each block column.
Definition: starsh.h:445
STARSH_int * brow_far
List of admissibly far block columns for each block row.
Definition: starsh.h:397
void starsh_blrm_info(STARSH_blrm *matrix)
Definition: blrm.c:189
int starsh_blrm__dqp3_omp(STARSH_blrm **matrix, STARSH_blrf *format, int maxrank, double tol, int onfly)
Approximate each tile of BLR matrix with RRQR (GEQP3 function).
Definition: dqp3.c:16
char symm
‘&#39;S’if problem is symmetric, and&#39;N&#39;` otherwise.
Definition: starsh.h:209
int starsh_blrm__dsdd_omp(STARSH_blrm **matrix, STARSH_blrf *format, int maxrank, double tol, int onfly)
Approximate each tile by divide-and-conquer SVD (GESDD function).
Definition: dsdd.c:16
STARSH_int * block_near
Coordinates of near-field admissible blocks.
Definition: starsh.h:422
int starsh_blrm__dca(STARSH_blrm *matrix, Array *A)
Convert double precision block low-rank matrix to dense Array.
Definition: dca.c:16
int * far_rank
Rank of each far-field block.
Definition: starsh.h:505
int starsh_application(void **data, STARSH_kernel **kernel, STARSH_int count, char dtype, int problem_type, int kernel_type,...)
Generates data and matrix kernel for one of predefined applications.
Definition: common.c:22
STARSH_cluster * col_cluster
Clusterization of columns into subclusters (block columns).
Definition: starsh.h:378