10 Specialisation of dastgen2.attributes.DoubleArray which relies on
11 Peano's tarch. Therefore, things alike the vector initialisation
12 in the constructor do work.
16 def __init__(self, name, cardinality, valid_mantissa_bits=None, ifdefs=[]):
18 See superclass' constructor.
21 This is important: It is not (necessarily) an integer, but can be
22 a string which is defined via a pragma or constexpr later.
25 super(Peano4DoubleArray, self).
__init__(
26 name, cardinality, valid_mantissa_bits=valid_mantissa_bits, ifdefs=ifdefs
30 def get_methods(self, _full_qualified_class_name, for_declaration=True):
34 "get" + accessor_name +
"() const",
40 +
"(const tarch::la::Vector<"
45 (
"get" + accessor_name +
"(int index) const",
"double"),
46 (
"set" + accessor_name +
"(int index, double value)",
"void"),
58 "[[clang::truncate_mantissa("
61 [
"defined(" + LLVMSymbol +
")"],
67 [
"!defined(" + LLVMSymbol +
")"],
79 return [(
"_" + self.
_name_name +
".data()[0]",
"double")]
92 signature.startswith(
"get")
93 and "index" in signature
96 return " return " + name +
"(index);\n"
98 signature.startswith(
"set")
99 and "index" in signature
102 return name +
"(index) = value;\n"
104 return " return " + name +
";\n"
106 return name +
" = value;\n"
108 signature.startswith(
"get")
109 and "index" in signature
112 return " return " + name +
"[index];\n"
114 signature.startswith(
"set")
115 and "index" in signature
118 return name +
"[index] = value;\n"
122 tarch::la::Vector<"""
124 +
""",double> result;
157 Return string representation of attribute.
An array of doubles, i.e.
Specialisation of dastgen2.attributes.DoubleArray which relies on Peano's tarch.
get_constructor_arguments(self)
Return list of tuple of arguments for the constructor.
get_method_body(self, signature)
I hand in the method signature (see get_methods()) and wanna get the whole implementation.
get_to_string(self)
Return string representation of attribute.
get_methods(self, _full_qualified_class_name, for_declaration=True)
Return sequence of methods that are defined for this attribute.
get_first_plain_C_attribute(self)
For MPI for example, I need to know the first attribute.
get_native_MPI_type(self)
Return native (built-in) MPI datatype.
__init__(self, name, cardinality, valid_mantissa_bits=None, ifdefs=[])
See superclass' constructor.
use_default_copy_constructor(self)
Cannot use the default copy constructor, as it is an array, i.e.
get_plain_C_attributes(self, for_constructor=False)
Return list of n-tuples.