strumpack::HSS::HSSOptions< scalar_t > Class Template Reference

Class containing several options for the HSS code and data-structures. More...

#include <HSSOptions.hpp>

Inheritance diagram for strumpack::HSS::HSSOptions< scalar_t >:
Collaboration diagram for strumpack::HSS::HSSOptions< scalar_t >:

Public Types

using real_t = typename RealType< scalar_t >::value_type
 

Public Member Functions

 HSSOptions (const structured::StructuredOptions< scalar_t > &sopts)
 
void set_d0 (int d0)
 
void set_dd (int dd)
 
void set_p (int p)
 
void set_nnz0 (int nnz0)
 
void set_nnz (int nnz)
 
void set_random_engine (random::RandomEngine random_engine)
 
void set_random_distribution (random::RandomDistribution random_distribution)
 
void set_compression_algorithm (CompressionAlgorithm a)
 
void set_compression_sketch (CompressionSketch a)
 
void set_SJLT_algo (SJLTAlgo a)
 
void set_clustering_algorithm (ClusteringAlgorithm a)
 
void set_approximate_neighbors (int neighbors)
 
void set_ann_iterations (int iters)
 
void set_user_defined_random (bool user_defined_random)
 
void set_synchronized_compression (bool sync)
 
void set_log_ranks (bool log_ranks)
 
int d0 () const
 
int nnz0 () const
 
int nnz () const
 
int dd () const
 
int p () const
 
random::RandomEngine random_engine () const
 
random::RandomDistribution random_distribution () const
 
CompressionAlgorithm compression_algorithm () const
 
CompressionSketch compression_sketch () const
 
SJLTAlgo SJLT_algo () const
 
ClusteringAlgorithm clustering_algorithm () const
 
int approximate_neighbors () const
 
int ann_iterations () const
 
bool user_defined_random () const
 
bool synchronized_compression () const
 
bool log_ranks () const
 
void set_from_command_line (int argc, const char *const *cargv) override
 
void describe_options () const override
 
- Public Member Functions inherited from strumpack::structured::StructuredOptions< scalar_t >
 StructuredOptions (Type type)
 
void set_rel_tol (real_t rel_tol)
 
void set_abs_tol (real_t abs_tol)
 
void set_leaf_size (int leaf_size)
 
void set_max_rank (int max_rank)
 
void set_type (Type a)
 
void set_verbose (bool verbose)
 
real_t rel_tol () const
 
real_t abs_tol () const
 
int leaf_size () const
 
int max_rank () const
 
Type type () const
 
bool verbose () const
 
virtual void set_from_command_line (int argc, const char *const *cargv)
 
virtual void describe_options () const
 

Detailed Description

template<typename scalar_t>
class strumpack::HSS::HSSOptions< scalar_t >

Class containing several options for the HSS code and data-structures.

Template Parameters
scalar_tscalar type, can be float, double, std::complex<float> or std::complex<double>. This is used here mainly because tolerances might depend on the precision.

Member Typedef Documentation

◆ real_t

template<typename scalar_t >
using strumpack::HSS::HSSOptions< scalar_t >::real_t = typename RealType<scalar_t>::value_type

real_t is the real type corresponding to the (possibly complex) scalar_t template parameter

Member Function Documentation

◆ ann_iterations()

template<typename scalar_t >
int strumpack::HSS::HSSOptions< scalar_t >::ann_iterations ( ) const
inline

Get the number of iterations used in the approximate nearest neighbors search algorithm used in the HSS compression algorithm for kernel matrices. The algorithm will build iters number of random trees.

Returns
Number of random trees to be build

◆ approximate_neighbors()

template<typename scalar_t >
int strumpack::HSS::HSSOptions< scalar_t >::approximate_neighbors ( ) const
inline

Get the number of approximate nearest neighbors used in the HSS compression algorithm for kernel matrices.

Returns
Number of approximate neighbors

◆ clustering_algorithm()

template<typename scalar_t >
ClusteringAlgorithm strumpack::HSS::HSSOptions< scalar_t >::clustering_algorithm ( ) const
inline

Get the clustering algorithm to be used. This is used when constructing an HSS approximation of a kernel matrix.

Returns
clustering algorithm
See also
set_clustering_algorithm

◆ compression_algorithm()

template<typename scalar_t >
CompressionAlgorithm strumpack::HSS::HSSOptions< scalar_t >::compression_algorithm ( ) const
inline

Return which variant of the compression algorithm to use.

Returns
Variant of HSS compression algorithm
See also
set_compression_algorithm

◆ d0()

template<typename scalar_t >
int strumpack::HSS::HSSOptions< scalar_t >::d0 ( ) const
inline

Get the initial number of random vector that will be used in adaptive randomized HSS compression. See the manual for more info.

Returns
initial guess for the rank, used in adaptive compression
See also
set_d0(), set_dd(), set_p()

◆ dd()

template<typename scalar_t >
int strumpack::HSS::HSSOptions< scalar_t >::dd ( ) const
inline

Increment for the number of random vectors during adaptive compression.

Returns
amount with which the number of random vectors will be incremented
See also
set_d0(), set_dd()

◆ describe_options()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::describe_options ( ) const
overridevirtual

Print an overview of the available command line options and their current values.

Reimplemented from strumpack::structured::StructuredOptions< scalar_t >.

◆ log_ranks()

template<typename scalar_t >
bool strumpack::HSS::HSSOptions< scalar_t >::log_ranks ( ) const
inline

Check if the ranks should be printed to a log file. NOT supported currently

Returns
True is the ranks should be printed to a log file, else False.
See also
set_log_ranks

◆ nnz()

template<typename scalar_t >
int strumpack::HSS::HSSOptions< scalar_t >::nnz ( ) const
inline

Get the increment number of nonzero entries per row in the SJLT sketch when incrementing by size dd

Returns
additional number of nonzeros per row, added in adaptive compression step with SJLT
See also
set_nnz0(), set_nnz()

◆ nnz0()

template<typename scalar_t >
int strumpack::HSS::HSSOptions< scalar_t >::nnz0 ( ) const
inline

Get the initial number of nonzero entries per row in the SJLT sketch.

Returns
initial number of nonzeros per row, used in adaptive compression with SJLT
See also
set_nnz0(), set_nnz()

◆ p()

template<typename scalar_t >
int strumpack::HSS::HSSOptions< scalar_t >::p ( ) const
inline

Get the current value of the oversampling parameter.

Returns
the oversampling parameter.
See also
set_p()

◆ random_distribution()

template<typename scalar_t >
random::RandomDistribution strumpack::HSS::HSSOptions< scalar_t >::random_distribution ( ) const
inline

Return the type of random distribution to use in the random sampling HSS construction.

Returns
random distribution
See also
set_random_distribution

◆ random_engine()

template<typename scalar_t >
random::RandomEngine strumpack::HSS::HSSOptions< scalar_t >::random_engine ( ) const
inline

Return the type of random engine to use.

Returns
random engine
See also
set_random_engine

◆ set_ann_iterations()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_ann_iterations ( int  iters)
inline

Set the number of iterations used in the approximate nearest neighbors search algorithm used in the HSS compression algorithm for kernel matrices. The algorithm will build iters number of random trees.

Parameters
itersNumber of random trees to be build

◆ set_approximate_neighbors()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_approximate_neighbors ( int  neighbors)
inline

Set the number of approximate nearest neighbors used in the HSS compression algorithm for kernel matrices.

Parameters
neighborsNumber of approximate neighbors

◆ set_clustering_algorithm()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_clustering_algorithm ( ClusteringAlgorithm  a)
inline

Specify the clustering algorithm. This is used when constructing a kernel matrix approximation.

Parameters
aClustering algorithm.

◆ set_compression_algorithm()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_compression_algorithm ( CompressionAlgorithm  a)
inline

Specify the variant of the adaptive compression algorithm. See the manual for more information.

Parameters
aType of (adaptive) compression scheme

◆ set_compression_sketch()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_compression_sketch ( CompressionSketch  a)
inline

Specify the variant of the sketching matrix.

Parameters
aType of sketching matrix

◆ set_d0()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_d0 ( int  d0)
inline

Set the initial number of random samples to be used in the random sampling HSS construction algorithm. See the manual for more information on the randomized compression algorithm.

◆ set_dd()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_dd ( int  dd)
inline

Set the number of random to be used to increment the random samples vectors in the adaptive randomized HSS compression algorithm. This is only used when compression_algorithm() == CompressionAlgorithm::STABLE. See the manual for more information on the randomized compression algorithm.

◆ set_from_command_line()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_from_command_line ( int  argc,
const char *const *  cargv 
)
overridevirtual

Parse the command line options given by argc and argv. The options will not be modified. Run with –help to see an overview of available options, or call describe_options().

Parameters
argcNumber of elements in argv
argvArray with options

Reimplemented from strumpack::structured::StructuredOptions< scalar_t >.

◆ set_log_ranks()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_log_ranks ( bool  log_ranks)
inline

Log the HSS ranks to a file. TODO is this currently supported??

◆ set_nnz()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_nnz ( int  nnz)
inline

Set the number of nonzeros per row added each time dd columns are added to the SJLT sketch.

◆ set_nnz0()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_nnz0 ( int  nnz0)
inline

Set the initial number of nonzeros per row to be used in SJLT sketch.

◆ set_p()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_p ( int  p)
inline

Oversampling parameter. Used in adaptive compression, to check stopping criterion.

◆ set_random_distribution()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_random_distribution ( random::RandomDistribution  random_distribution)
inline

Set the random distribution, used in randomized compression.

See also
RandomEngine, RandomDistribution, set_random_engine()

◆ set_random_engine()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_random_engine ( random::RandomEngine  random_engine)
inline

Set the random engine, used in randomized compression.

See also
RandomEngine, RandomDistribution, set_random_distribution()

◆ set_SJLT_algo()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_SJLT_algo ( SJLTAlgo  a)
inline

Specify the variant of the sketching matrix.

Parameters
aType of sketching matrix

◆ set_synchronized_compression()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_synchronized_compression ( bool  sync)
inline

Set this to true if you require communication in the element extraction routine, since in that case the element extraction is collective, and has to be synchronized.

◆ set_user_defined_random()

template<typename scalar_t >
void strumpack::HSS::HSSOptions< scalar_t >::set_user_defined_random ( bool  user_defined_random)
inline

Set this to true if you want to manually fill the random sample vectors with random values.

◆ synchronized_compression()

template<typename scalar_t >
bool strumpack::HSS::HSSOptions< scalar_t >::synchronized_compression ( ) const
inline

Whether or not the synchronize the element extraction routine.

Returns
True if synchronization is required in the element extraction routine, else False.
See also
set_synchromized_compression

◆ user_defined_random()

template<typename scalar_t >
bool strumpack::HSS::HSSOptions< scalar_t >::user_defined_random ( ) const
inline

Will the user define its own random matrices?

Returns
True if the user will fill up the random matrices, used in the random sampling based HSS construcion, him/her-self.
See also
set_user_defined_random

The documentation for this class was generated from the following file: