10#include <kernel/lafem/forward.hpp>
12#include <kernel/util/type_traits.hpp>
13#include <kernel/util/math.hpp>
14#include <kernel/util/random.hpp>
15#include <kernel/lafem/container.hpp>
16#include <kernel/lafem/dense_vector.hpp>
17#include <kernel/lafem/arch/dot_product.hpp>
18#include <kernel/lafem/arch/norm.hpp>
19#include <kernel/lafem/arch/scale.hpp>
20#include <kernel/lafem/arch/axpy.hpp>
21#include <kernel/lafem/arch/component_product.hpp>
22#include <kernel/lafem/arch/component_copy.hpp>
23#include <kernel/lafem/arch/component_invert.hpp>
24#include <kernel/lafem/arch/max_abs_index.hpp>
25#include <kernel/lafem/arch/min_abs_index.hpp>
26#include <kernel/lafem/arch/max_index.hpp>
27#include <kernel/lafem/arch/min_index.hpp>
28#include <kernel/lafem/arch/max_rel_diff.hpp>
29#include <kernel/util/tiny_algebra.hpp>
30#include <kernel/util/statistics.hpp>
31#include <kernel/util/time_stamp.hpp>
32#include <kernel/adjacency/permutation.hpp>
47 template <
typename DT_,
int BlockSize_, Perspective perspective_>
48 struct DenseVectorBlockedPerspectiveHelper
50 typedef Tiny::Vector<DT_, BlockSize_>
Type;
53 template <
typename DT_,
int BlockSize_>
54 struct DenseVectorBlockedPerspectiveHelper<DT_, BlockSize_,
Perspective::
pod>
79 template <
typename DT_,
typename IT_,
int BlockSize_>
93 template <
typename DT2_ = DT_,
typename IT2_ = IT_>
97 template <
typename DataType2_,
typename IndexType2_>
109 typedef DT_ DataType;
110 typedef IT_ IndexType;
119 _num_entries(IT_(vector.
size())),
124 template <
typename LocalVector_,
typename Mapping_>
125 void operator()(
const LocalVector_ & loc_vec,
const Mapping_ & mapping, DT_ alpha = DT_(1))
128 for (
int i(0); i < mapping.get_num_local_dofs(); ++i)
131 Index dof_idx = mapping.get_index(i);
132 ASSERT(dof_idx < _num_entries);
135 _data[dof_idx] += alpha * loc_vec[i];
149 typedef DT_ DataType;
150 typedef IT_ IndexType;
159 _num_entries(vector.
size()),
164 template <
typename LocalVector_,
typename Mapping_>
165 void operator()(LocalVector_ & loc_vec,
const Mapping_ & mapping, DT_ alpha = DT_(1))
168 for (
int i(0); i < mapping.get_num_local_dofs(); ++i)
171 Index dof_idx = mapping.get_index(i);
172 ASSERT(dof_idx < _num_entries);
175 loc_vec[i].axpy(alpha, _data[dof_idx]);
208 if (size_in ==
Index(0))
211 this->
_elements.push_back(MemoryPool::template allocate_memory<DT_>(size<Perspective::pod>()));
230 if (size_in ==
Index(0))
233 this->
_elements.push_back(MemoryPool::template allocate_memory<DT_>(size<Perspective::pod>()));
250 if (size_in ==
Index(0))
291 DT_ * te(
const_cast<DT_ *
>(dv_in.template elements<Perspective::pod>()));
331 template <
typename DT2_ = DT_,
typename IT2_ = IT_>
335 deserialize<DT2_, IT2_>(input);
351 if (size_in ==
Index(0))
354 this->
_elements.push_back(MemoryPool::template allocate_memory<DT_>(size<Perspective::pod>()));
357 this->
format(rng, min, max);
390 this->
move(std::forward<DenseVectorBlocked>(other));
405 t.
clone(*
this, clone_mode);
417 template<
typename DT2_,
typename IT2_>
430 template <
typename DT2_,
typename IT2_>
443 template <
typename DT2_,
typename IT2_>
446 XASSERTM(other.size() %
Index(BlockSize_) == 0,
"DenseVector cannot be converted to given blocksize!");
468 template <
typename DT2_ = DT_,
typename IT2_ = IT_>
487 template <
typename DT2_ = DT_,
typename IT2_ = IT_>
501 template <Perspective perspective_ = Perspective::native>
502 auto elements() const -> const typename Intern::DenseVectorBlockedPerspectiveHelper<DT_, BlockSize_, perspective_>::Type *
504 if (this->
size() == 0)
507 return (
const typename Intern::DenseVectorBlockedPerspectiveHelper<DT_, BlockSize_, perspective_>::Type *)(this->
_elements.at(0));
512 template <Perspective perspective_ = Perspective::native>
513 auto elements() ->
typename Intern::DenseVectorBlockedPerspectiveHelper<DT_, BlockSize_, perspective_>::Type *
515 if (this->
size() == 0)
518 return (
typename Intern::DenseVectorBlockedPerspectiveHelper<DT_, BlockSize_, perspective_>::Type *)(this->
_elements.at(0));
527 template <Perspective perspective_ = Perspective::native>
547 MemoryPool::synchronize();
549 return this->elements<Perspective::native>()[index];
561 this->elements<Perspective::native>()[index] =
value;
562 MemoryPool::synchronize();
572 return "DenseVectorBlocked";
583 this->_copy_content(x, full);
594 std::ios_base::openmode bin = std::ifstream::in | std::ifstream::binary;
596 bin = std::ifstream::in;
597 std::ifstream file(filename.c_str(), bin);
598 if (! file.is_open())
599 XABORTM(
"Unable to open Vector file " + filename);
621 std::getline(file, line);
622 if (line.find(
"%%MatrixMarket matrix array real general") == String::npos)
624 XABORTM(
"Input-file is not a compatible mtx-vector-file");
628 std::getline(file, line);
630 XABORTM(
"Input-file is empty");
632 String::size_type begin(line.find_first_not_of(
" "));
633 if (line.at(begin) !=
'%')
637 String::size_type begin(line.find_first_not_of(
" "));
638 line.erase(0, begin);
639 String::size_type end(line.find_first_of(
" "));
640 String srows(line, 0, end);
641 rows = (
Index)atol(srows.c_str());
644 begin = line.find_first_not_of(
" ");
645 line.erase(0, begin);
646 end = line.find_first_of(
" ");
647 String scols(line, 0, end);
651 XABORTM(
"Input-file is no dense-vector-file");
655 DT_ * pval(tmp.template elements<Perspective::pod>());
659 std::getline(file, line);
663 String::size_type begin(line.find_first_not_of(
" "));
664 line.erase(0, begin);
665 String::size_type end(line.find_first_of(
" "));
666 String sval(line, 0, end);
667 DT_ tval((DT_)atof(sval.c_str()));
672 this->
move(std::move(tmp));
680 std::vector<DT_> data;
685 std::getline(file, line);
686 if (line.find(
"#", 0) < line.npos)
693 std::string::size_type first_digit(line.find_first_not_of(
" "));
694 line.erase(0, first_digit);
695 std::string::size_type eol(line.length());
696 for (std::string::size_type i(0); i < eol; ++i)
698 n_z_s.append(1, line[i]);
701 DT_ n_z((DT_)atof(n_z_s.c_str()));
706 _size() =
Index(data.size()) /
Index(BlockSize_);
707 this->
_elements.push_back(MemoryPool::template allocate_memory<DT_>(
Index(data.size())));
709 MemoryPool::template copy<DT_>(this->
_elements.at(0), &data[0],
Index(data.size()));
721 XABORTM(
"Filemode not supported!");
733 std::ios_base::openmode bin = std::ofstream::out | std::ofstream::binary;
735 bin = std::ofstream::out;
737 char* buff =
nullptr;
743 file.open(filename.c_str(), bin);
745 XABORTM(
"Unable to open Matrix file " + filename);
766 const Index tsize(temp.template size<Perspective::pod>());
767 file <<
"%%MatrixMarket matrix array real general\n";
768 file << tsize <<
" " << 1 <<
"\n";
770 const DT_ * pval(temp.template elements<Perspective::pod>());
771 for (
Index i(0); i < tsize; ++i, ++pval)
779 DT_ * temp = MemoryPool::template allocate_memory<DT_>((this->size<Perspective::pod>()));
780 MemoryPool::template copy<DT_>(temp, this->
template elements<Perspective::pod>(), this->size<Perspective::pod>());
782 for (
Index i(0); i < this->size<Perspective::pod>(); ++i)
795 XABORTM(
"Filemode not supported!");
810 const DT_ alpha = DT_(1))
812 XASSERTM(x.
size() == this->size(),
"Vector size does not match!");
814 FEAT_KERNEL_MARKER_START(
"DV_axpy");
819 Arch::Axpy::value(elements<Perspective::pod>(), alpha, x.template elements<Perspective::pod>(), this->
size<
Perspective::pod>());
821 FEAT_KERNEL_MARKER_STOP(
"DV_axpy");
823 Statistics::add_time_axpy(ts_stop.
elapsed(ts_start));
836 XASSERTM(x.
size() == this->size(),
"Vector size does not match!");
838 FEAT_KERNEL_MARKER_START(
"DV_axpy");
843 Arch::Axpy::value_blocked(elements<Perspective::native>(), alpha, x.template elements<Perspective::native>(), this->
size<
Perspective::native>());
845 FEAT_KERNEL_MARKER_STOP(
"DV_axpy");
847 Statistics::add_time_axpy(ts_stop.
elapsed(ts_start));
863 Arch::ComponentProduct::value(elements<Perspective::pod>(), x.template elements<Perspective::pod>(), y.template elements<Perspective::pod>(), this->
size<
Perspective::pod>());
867 Statistics::add_time_axpy(ts_stop.
elapsed(ts_start));
878 XASSERTM(block_ >= 0,
"Block index has to be a positive integer!");
883 Arch::ComponentCopy::value(elements<Perspective::pod>(), x.template elements<Perspective::pod>(), BlockSize_, block_, this->
size<
Perspective::native>());
887 Statistics::add_time_axpy(ts_stop.
elapsed(ts_start));
898 XASSERTM(block_ >= 0,
"Block index has to be a positive integer!");
903 Arch::ComponentCopy::value_to(elements<Perspective::pod>(), x.template elements<Perspective::pod>(), BlockSize_, block_, this->
size<
Perspective::native>());
907 Statistics::add_time_axpy(ts_stop.
elapsed(ts_start));
925 Arch::ComponentInvert::value(this->
template elements<Perspective::pod>(), x.template elements<Perspective::pod>(), alpha, this->
size<
Perspective::pod>());
929 Statistics::add_time_axpy(ts_stop.
elapsed(ts_start));
940 XASSERTM(x.
size() == this->size(),
"Vector size does not match!");
944 Arch::Scale::value(elements<Perspective::pod>(), x.template elements<Perspective::pod>(), alpha, this->
size<
Perspective::pod>());
948 Statistics::add_time_axpy(ts_stop.
elapsed(ts_start));
959 XASSERTM(x.
size() == this->size(),
"Vector size does not match!");
963 Arch::Scale::value_blocked(elements<Perspective::native>(), x.template elements<Perspective::native>(), alpha, this->size<
Perspective::native>());
967 Statistics::add_time_axpy(ts_stop.
elapsed(ts_start));
981 XASSERTM(x.template size<Perspective::pod>() == this->template size<Perspective::pod>(),
"Vector size does not match!");
982 XASSERTM(y.template size<Perspective::pod>() == this->template size<Perspective::pod>(),
"Vector size does not match!");
987 DataType result = Arch::TripleDotProduct::value(this->
template elements<Perspective::pod>(), x.template elements<Perspective::pod>(), y.template elements<Perspective::pod>(), this->template size<Perspective::pod>());
990 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1006 XASSERTM(x.
size() == this->size(),
"Vector size does not match!");
1007 XASSERTM(y.
size() == this->size(),
"Vector size does not match!");
1012 ValueType result = Arch::TripleDotProduct::value_blocked(elements<Perspective::native>(), x.template elements<Perspective::native>(), y.template elements<Perspective::native>(), this->
size<
Perspective::native>());
1015 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1029 XASSERTM(x.
size() == this->size(),
"Vector size does not match!");
1034 DataType result = Arch::DotProduct::value(elements<Perspective::pod>(), x.template elements<Perspective::pod>(), this->
size<
Perspective::pod>());
1037 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1051 XASSERTM(x.
size() == this->size(),
"Vector size does not match!");
1056 ValueType result = Arch::DotProduct::value_blocked(elements<Perspective::native>(), x.template elements<Perspective::native>(), this->
size<
Perspective::native>());
1059 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1074 DataType result = Arch::Norm2::value(elements<Perspective::pod>(), this->size<Perspective::pod>());
1077 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1092 ValueType result = Arch::Norm2::value_blocked(elements<Perspective::native>(), this->size<Perspective::native>());
1095 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1121 ValueType result = Arch::Norm2Sqr::value_blocked(elements<Perspective::native>(), this->size<Perspective::native>());
1124 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1138 Index max_abs_index = Arch::MaxAbsIndex::value(this->
template elements<Perspective::pod>(), this->
template size<Perspective::pod>());
1139 ASSERT(max_abs_index < this->
template size<Perspective::pod>());
1141 MemoryPool::template copy<DT_>(&result, this->
template elements<Perspective::pod>() + max_abs_index, 1);
1145 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1159 ValueType result = Arch::MaxAbsIndex::value_blocked(this->
template elements<Perspective::native>(), this->
template size<Perspective::native>());
1162 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1176 Index min_abs_index = Arch::MinAbsIndex::value(this->
template elements<Perspective::pod>(), this->
template size<Perspective::pod>());
1177 ASSERT(min_abs_index < this->
template size<Perspective::pod>());
1179 MemoryPool::template copy<DT_>(&result, this->
template elements<Perspective::pod>() + min_abs_index, 1);
1183 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1197 ValueType result = Arch::MinAbsIndex::value_blocked(this->
template elements<Perspective::native>(), this->
template size<Perspective::native>());
1200 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1214 Index max_index = Arch::MaxIndex::value(this->
template elements<Perspective::pod>(), this->
template size<Perspective::pod>());
1215 ASSERT(max_index < this->
template size<Perspective::pod>());
1217 MemoryPool::template copy<DT_>(&result, this->
template elements<Perspective::pod>() + max_index, 1);
1220 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1234 ValueType result = Arch::MaxIndex::value_blocked(this->
template elements<Perspective::native>(), this->
template size<Perspective::native>());
1237 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1251 Index min_index = Arch::MinIndex::value(this->
template elements<Perspective::pod>(), this->
template size<Perspective::pod>());
1252 ASSERT(min_index < this->
template size<Perspective::pod>());
1254 MemoryPool::template copy<DT_>(&result, this->
template elements<Perspective::pod>() + min_index, 1);
1257 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1271 ValueType result = Arch::MinIndex::value_blocked(this->
template elements<Perspective::native>(), this->
template size<Perspective::native>());
1274 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1290 DataType max_rel_diff = Arch::MaxRelDiff::value(this->
template elements<Perspective::pod>(), x.template elements<Perspective::pod>(), this->template size<Perspective::pod>());
1293 Statistics::add_time_reduction(ts_stop.
elapsed(ts_start));
1308 if (this->
size() == 0 && x.
size() == 0 && this->get_elements().size() == 0 && x.
get_elements().size() == 0)
1325 if (perm.
size() == 0)
1328 XASSERTM(perm.
size() == this->size(),
"Container size does not match permutation size");
1330 perm.
apply(elements<Perspective::native>());
1335 void set_vec(DT_ *
const pval_set)
const
1337 MemoryPool::copy(pval_set, this->
template elements<Perspective::pod>(), this->size<Perspective::pod>());
1341 void set_vec_inv(
const DT_ *
const pval_set)
1343 MemoryPool::copy(this->
template elements<Perspective::pod>(), pval_set, this->size<Perspective::pod>());
1360 for (
int j(0); j < BlockSize_; ++j)
1377 template<
typename DT2_,
typename IT2_>
1381 XASSERTM(this->
size() == projected_vector.
size(),
"Target size do not match");
#define ASSERT(expr)
Debug-Assertion macro definition.
#define XABORTM(msg)
Abortion macro definition with custom message.
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
Index size() const
returns the size of the permutation
void apply(Tx_ *x, bool invert=false) const
Applies In-Situ permutation.
const std::vector< IT_ * > & get_indices() const
Returns a list of all Index arrays.
bool _foreign_memory
do we use memory that we did not allocate, nor are we allowed to free it - this mostly holds true,...
std::vector< DT_ * > _elements
List of pointers to all datatype dependent arrays.
Index used_elements() const
Returns the number of effective stored elements.
const std::vector< DT_ * > & get_elements() const
Returns a list of all data arrays.
std::vector< Index > _elements_size
List of corresponding datatype array sizes.
Index size() const
Returns the containers size.
void assign(const Container< DT2_, IT2_ > &other)
Assignment operation.
std::vector< IT_ * > _indices
List of pointers to all IT_ dependent arrays.
void clone(const Container &other, CloneMode clone_mode=CloneMode::Weak)
Clone operation.
void move(Container &&other)
Assignment move operation.
virtual void clear()
Free all allocated arrays.
void format(DT_ value=DT_(0))
Reset all elements of the container to a given value or zero if missing.
std::vector< Index > _scalar_index
List of scalars with datatype index.
Gather-Axpy operation for DenseVectorBlocked.
Scatter-Axpy operation for DenseVectorBlocked.
Blocked Dense data vector class template.
void read_from(FileMode mode, std::istream &file)
Read in vector from stream.
DT_ max_abs_element() const
Retrieve the absolute maximum value of this vector.
DenseVectorBlocked(std::vector< char > input)
Constructor.
virtual ~DenseVectorBlocked()
Destructor.
void convert(const DenseVectorBlocked< DT2_, IT2_, BlockSize_ > &other)
Conversion method.
static constexpr int BlockSize
Our size of a single block.
static String name()
Returns a descriptive string.
ValueType dot_blocked(const DenseVectorBlocked &x) const
Calculate .
DenseVectorBlocked(DenseVectorBlocked &&other)
Move Constructor.
ValueType min_abs_element_blocked() const
Retrieve the absolute minimum value of this vector.
void project_onto(DenseVectorBlocked< DT_, IT_, BlockSize_ > &projected_vector, const LAFEM::DenseVectorBlocked< DT2_, IT2_, BlockSize_ > &normal_vector) const
Projects this vector onto a another one.
DenseVectorBlocked(Random &rng, Index size_in, DataType min, DataType max)
Constructor.
void axpy(const DenseVectorBlocked &x, const DT_ alpha=DT_(1))
Calculate .
void permute(Adjacency::Permutation &perm)
Permutate vector according to the given Permutation.
void write_out(FileMode mode, const String &filename) const
Write out vector to file.
void copy(const DenseVectorBlocked &x, bool full=false)
Performs .
void convert(const DenseVector< DT2_, IT2_ > &other)
Conversion method.
void read_from(FileMode mode, const String &filename)
Read in vector from file.
DenseVectorBlocked(Index size_in)
Constructor.
ValueType max_element_blocked() const
Retrieve the maximum value of this vector.
void component_product(const DenseVectorBlocked &x, const DenseVectorBlocked &y)
Calculate .
auto elements() const -> const typename Intern::DenseVectorBlockedPerspectiveHelper< DT_, BlockSize_, perspective_ >::Type *
Retrieve a pointer to the data array.
bool same_layout(const DenseVectorBlocked &x) const
Checks if the structural layout of this vector matches that of another vector. This excludes comparis...
void scale(const DenseVectorBlocked &x, const DT_ alpha)
Calculate .
DenseVectorBlocked(Index size_in, DT_ *data)
Constructor.
DataType dot(const DenseVectorBlocked &x) const
Calculate .
DT_ norm2() const
Calculates and returns the euclid norm of this vector.
ValueType min_element_blocked() const
Retrieve the minimum value of this vector.
DenseVectorBlocked(FileMode mode, const String &filename)
Constructor.
void clone(const DenseVectorBlocked< DT2_, IT2_, BlockSize_ > &other, CloneMode clone_mode=CloneMode::Deep)
Clone operation.
DenseVectorBlocked & operator=(DenseVectorBlocked &&other)
Assignment move operator.
DT_ max_element() const
Retrieve the maximum value of this vector.
Index size() const
The number of elements.
DT_ max_rel_diff(const DenseVectorBlocked &x) const
Retrieve the maximum relative difference of this vector and another one y.max_rel_diff(x) returns .
ValueType norm2_blocked() const
Calculates and returns the euclid norm of this vector.
void component_copy_to(DenseVector< DT_, IT_ > &x, const int block_) const
Copies the elements of a specific block of this blocked vector into a dense vector.
Tiny::Vector< DT_, BlockSize_ > ValueType
Our value type.
DT_ min_abs_element() const
Retrieve the absolute minimum value of this vector.
void operator()(Index index, const Tiny::Vector< DT_, BlockSize_ > &value)
Set specific vector element.
void deserialize(std::vector< char > input)
Deserialization of complete container entity.
auto elements() -> typename Intern::DenseVectorBlockedPerspectiveHelper< DT_, BlockSize_, perspective_ >::Type *
DenseVectorBlocked()
Constructor.
void component_invert(const DenseVectorBlocked &x, const DT_ alpha=DT_(1))
Performs .
DT_ min_element() const
Retrieve the minimum value of this vector.
DataType triple_dot(const DenseVectorBlocked &x, const DenseVectorBlocked &y) const
Calculate .
friend std::ostream & operator<<(std::ostream &lhs, const DenseVectorBlocked &b)
DenseVectorBlocked streaming operator.
DenseVectorBlocked clone(CloneMode clone_mode=CloneMode::Deep) const
Clone operation.
void component_copy(const DenseVector< DT_, IT_ > &x, const int block_)
Copies the elements of a dense vector into a specific block of this blocked vector.
DenseVectorBlocked(FileMode mode, std::istream &file)
Constructor.
ValueType max_abs_element_blocked() const
Retrieve the absolute maximum value of this vector.
void scale_blocked(const DenseVectorBlocked &x, const ValueType alpha)
Calculate .
std::vector< char > serialize(const LAFEM::SerialConfig &config=LAFEM::SerialConfig()) const
Serialization of complete container entity.
DenseVectorBlocked(const DenseVectorBlocked &dv_in, Index size_in, Index offset_in)
Constructor.
ValueType norm2sqr_blocked() const
Calculates and returns the squared euclid norm of this vector.
IT_ IndexType
Our indextype.
DT_ DataType
Our datatype.
const Tiny::Vector< DT_, BlockSize_ > operator()(Index index) const
Retrieve specific vector element.
ValueType triple_dot_blocked(const DenseVectorBlocked &x, const DenseVectorBlocked &y) const
Calculate .
void write_out(FileMode mode, std::ostream &file) const
Write out vector to file.
DT_ norm2sqr() const
Calculates and returns the squared euclid norm of this vector.
DenseVectorBlocked(Index size_in, DT_ value)
Constructor.
void axpy_blocked(const DenseVectorBlocked &x, const ValueType alpha)
Calculate .
DenseVectorBlocked(const DenseVector< DT_, IT_ > &other)
Constructor.
Dense data vector class template.
Config class for serialize parameter.
static void copy(DT_ *dest, const DT_ *src, const Index count)
Copy memory area from src to dest.
static void set_memory(DT_ *address, const DT_ val, const Index count=1)
set memory to specific value
static void release_memory(void *address)
release memory or decrease reference counter
static void increase_memory(void *address)
increase memory counter
Pseudo-Random Number Generator.
static void add_flops(Index flops)
Add an amount of flops to the global flop counter.
String class implementation.
double elapsed(const TimeStamp &before) const
Calculates the time elapsed between two time stamps.
Tiny Vector class template.
constexpr std::size_t FileOutStreamBufferSize
OutStreamBufferSize.
T_ abs(T_ x)
Returns the absolute value.
T_ sqr(T_ x)
Returns the square of a value.
Type
bitmask for zfp header
CUDA_HOST Vector< T_, dim_ > project_onto(const Vector< T_, dim_ > &x, const Vector< T_, dim_ > &y)
Calculates the projected vector.
String stringify(const T_ &item)
Converts an item into a String.
String stringify_fp_sci(DataType_ value, int precision=0, int width=0, bool sign=false)
Prints a floating point value to a string in scientific notation.
@ value
specifies whether the space should supply basis function values
std::uint64_t Index
Index data type.