21 #ifndef __ANTARES_LIBS_ARRAY_MATRIX_HXX__
22 #define __ANTARES_LIBS_ARRAY_MATRIX_HXX__
28 #include <yuni/yuni.h>
29 #include <yuni/core/string.h>
31 #include <antares/io/statistics.h>
32 #include <antares/logs/logs.h>
34 #include "matrix-to-buffer.h"
36 #define ANTARES_MATRIX_CSV_COMMA "\t;,"
37 #define ANTARES_MATRIX_CSV_SEPARATORS "\t\r\n;,"
44 class MatrixData final
47 inline static void Init(T& data)
53 inline static void Copy(T& data,
const U& value)
55 data =
static_cast<T
>(value);
58 inline static void Copy(T&,
const AnyString&)
62 logs.error() <<
"internal error: matrix data conversion";
66 template<u
int ChunkSizeT,
bool ExpandableT>
67 class MatrixData<Yuni::CString<ChunkSizeT, ExpandableT>> final
70 using StringT = Yuni::CString<ChunkSizeT, ExpandableT>;
73 inline static void Init(StringT& data)
79 inline static void Copy(StringT& data,
const U& value)
86 template<
class ReadWriteType>
87 class MatrixStringConverter final
96 inline static bool Do(
const AnyString& str, ReadWriteType& out)
103 class MatrixStringConverter<double> final
112 inline static bool Do(
const AnyString& str,
double& out)
115 out = ::strtod(str.c_str(), &pend);
116 return (NULL != pend and
'\0' == *pend);
121 class MatrixStringConverter<float> final
130 inline static bool Do(
const AnyString& str,
float& out)
133 out =
static_cast<float>(::strtod(str.c_str(), &pend));
134 return (NULL != pend and
'\0' == *pend);
138 template<u
int ChunkSizeT,
bool ExpandableT>
139 class MatrixStringConverter<Yuni::CString<ChunkSizeT, ExpandableT>> final
147 using StringT = Yuni::CString<ChunkSizeT, ExpandableT>;
150 inline static bool Do(
const AnyString& str, StringT& out)
157 template<
unsigned A,
bool B>
158 Yuni::CString<A, B> trunc(Yuni::CString<A, B>& str)
164 static T trunc(T& in)
166 return static_cast<T
>(std::trunc(in));
169 template<
class T,
class P>
170 class MatrixRound final
173 static T Value(P value)
175 return static_cast<T
>(trunc(value));
180 class MatrixRound<T, double> final
183 static T Value(
double value)
185 return static_cast<T
>(value);
190 class MatrixRound<T, float> final
193 static T Value(
float value)
195 return static_cast<T
>(value);
200 template<
class T,
class ReadWriteT>
209 template<
class T,
class ReadWriteT>
215 if (0 == width or 0 == height)
221 entry =
new typename Antares::Memory::Stored<T>::Type[w + 1];
224 for (uint i = 0; i != w; ++i)
226 Antares::Memory::Allocate<T>(entry[i], h);
231 template<
class T,
class ReadWriteT>
245 entry =
new typename Antares::Memory::Stored<T>::Type[
width + 1];
248 for (uint i = 0; i != rhs.
width; ++i)
256 template<
class T,
class ReadWriteT>
260 *
this = std::move(rhs);
263 template<
class T,
class ReadWriteT>
264 template<
class U,
class V>
274 template<
class T,
class ReadWriteT>
278 and
"Internal variable jit is set but JIT is not globally enabled (overflow?)");
283 for (uint i = 0; i != width; ++i)
291 template<
class T,
class ReadWriteT>
294 for (uint i = 0; i != width; ++i)
297 (void)::memset((
void*)column, 0,
sizeof(T) * height);
301 template<
class T,
class ReadWriteT>
309 for (uint i = 1; i != width; ++i)
312 for (uint j = 0; j != height; ++j)
314 first[j] += column[j];
319 double coeff = 1. / width;
322 for (uint j = 0; j != height; ++j)
324 const double d = first[j] * coeff;
325 first[j] = std::round(d);
330 for (uint j = 0; j != height; ++j)
337 for (uint i = 1; i != width; ++i)
346 template<
class T,
class ReadWriteT>
349 for (uint i = 0; i != width; ++i)
353 for (uint j = 0; j != height; ++j)
360 template<
class T,
class ReadWriteT>
363 for (uint i = 0; i != width; ++i)
367 (void)::memset((
void*)column, 0,
sizeof(T) * height);
373 template<
class T,
class ReadWriteT>
377 return (reload) ? loadAllJITData() : true;
380 template<
class T,
class ReadWriteT>
383 resize(w, h, fixedSize);
387 template<
class T,
class ReadWriteT>
399 jit->minWidth = minWidth;
400 jit->maxHeight = maxHeight;
401 jit->options = options;
405 template<
class T,
class ReadWriteT>
408 return loadFromCSVFile(filename,
411 optImmediate | optNoWarnIfEmpty | optNeverFails | optQuiet);
414 template<
class T,
class ReadWriteT>
420 return loadFromCSVFile(filename, minWidth, maxHeight, optNone, buffer);
423 template<
class T,
class ReadWriteT>
430 assert(not filename.empty() and
"Matrix<>:: loadFromCSVFile: empty filename");
435 return internalLoadJITData(filename, minWidth, maxHeight, options);
440 return internalLoadCSVFile(filename, minWidth, maxHeight, options, buffer);
444 template<
class T,
class ReadWriteT>
447 bool print_dimensions,
448 bool saveEvenIfAllZero)
const
451 return internalSaveCSVFile(filename, precision, print_dimensions, predicate, saveEvenIfAllZero);
454 template<
class T,
class ReadWriteT>
455 template<
class PredicateT>
458 bool print_dimensions,
459 PredicateT& predicate,
460 bool saveEvenIfAllZero)
const
462 return internalSaveCSVFile(filename, precision, print_dimensions, predicate, saveEvenIfAllZero);
465 template<
class T,
class ReadWriteT>
469 assert(x < width and
"Invalid column index (bigger than `this->width`)");
474 if (Yuni::Static::Type::StrictlyEqual<T, U>::Yes)
476 (void)::memcpy(column, data,
sizeof(T) * height);
481 for (uint y = 0; y != height; ++y)
483 column[y] = (T)data[y];
490 template<
class T,
class ReadWriteT>
493 assert(x < width and
"Invalid column index (bigger than `this->width`)");
496 for (uint y = 0; y != height; ++y)
504 template<
class T,
class ReadWriteT>
507 assert(x < width and
"Invalid column index (bigger than `this->width`)");
510 (void)::memset((
void*)column, 0,
sizeof(T) * height);
515 template<
class T,
class ReadWriteT>
524 template<
class T,
class ReadWriteT>
527 return (!width) or (!height);
530 template<
class T,
class ReadWriteT>
535 for (uint i = 0; i != width; ++i)
546 template<
class T,
class ReadWriteT>
553 template<
class T,
class ReadWriteT>
559 assert(w <= 50000 and
"The new width seems a bit excessive");
560 assert(h <= 50000 and
"The new height seems a bit excessive");
563 if (w != width or h != height)
573 for (uint i = 0; i != width; ++i)
585 entry =
new typename Antares::Memory::Stored<T>::Type[width + 1];
586 entry[width] =
nullptr;
588 for (uint i = 0; i != w; ++i)
590 Antares::Memory::Allocate<T>(entry[i], height);
601 if (jit and w != 0 and h != 0)
607 jit->options = jit->options | optFixedSize;
615 static inline bool DetectEncoding(
const AnyString& filename,
const AnyString& data,
size_t& offset)
620 if ((
unsigned char)data[0] == 0xFE and ((
unsigned char)data[1]) == 0xFF)
622 if (data.size() > 3 and !data[2] and !data[3])
624 logs.error() <<
'`' << filename
625 <<
"`: UTF-32 Little Endian encoding detected. ASCII/UTF-8 required.";
629 logs.error() <<
'`' << filename
630 <<
"`: UTF-16 Big Endian encoding detected. ASCII/UTF-8 required.";
635 if ((
unsigned char)data[0] == 0xFF and ((
unsigned char)data[1]) == 0xFE)
637 logs.error() <<
'`' << filename
638 <<
"`: UTF-16 Little Endian encoding detected. ASCII/UTF-8 required.";
642 if ((
unsigned char)data[0] == 0xEF and ((
unsigned char)data[1]) == 0xBB and data.size() > 2
643 and ((
unsigned char)data[2]) == 0xBF)
650 if (!data[0] and !data[1] and ((
unsigned char)data[2]) == 0xFE
651 and ((
unsigned char)data[3]) == 0xFF)
653 logs.error() <<
'`' << filename
654 <<
"`: UTF-32 Big Endian encoding detected. ASCII/UTF-8 required.";
663 template<
class T,
class ReadWriteT>
664 bool Matrix<T, ReadWriteT>::loadFromBuffer(
const AnyString& filename,
671 using namespace Yuni;
673 logs.debug() <<
" :: loading `" << filename <<
"`";
678 if (not DetectEncoding(filename, data, bom))
681 reset((minWidth > 0 ? minWidth : 1), maxHeight);
685 uint offset = (uint)bom;
692 reset(minWidth, maxHeight,
true);
699 assert(not data.empty());
700 maxHeight = data.countChar(
'\n');
701 if (data.last() ==
'\n')
712 YString::Size max = data.find(
'\n');
713 if (max == BufferType::npos)
715 logs.error() << filename <<
": At least one line-return must be available";
716 reset(minWidth, maxHeight);
725 char c = data[max - 1];
726 if (c ==
'\r' or c ==
'\t' or c ==
' ')
740 if (max > 7 and data.startsWith(
"size:"))
742 CString<64, false> buffer;
743 buffer.assign(data.c_str(), max);
746 sscanf_s(buffer.c_str(),
"size:%dx%d", &x, &y);
748 sscanf(buffer.c_str(),
"size:%dx%d", &x, &y);
752 if (!(options & optQuiet))
754 logs.warning() <<
'`' << filename <<
"`: Invalid header";
760 if (!(options & optQuiet))
762 logs.warning() <<
'`' << filename <<
"`: Invalid header";
767 resize((uint)x, (uint)y);
772 x = ((max > 0) ? 1 : 0);
776 while ((offset = (uint)data.find_first_of(ANTARES_MATRIX_CSV_COMMA, offset)) < max)
782 resize(((x < minWidth) ? minWidth : x), maxHeight);
785 if (not(options & optQuiet) and not(options & optNoWarnIfEmpty))
787 logs.warning() <<
"`" << filename <<
"`: Invalid format: The file seems empty";
800 char separator =
'\0';
802 ReadWriteType cellValue;
805 while (y < maxHeight and offset < (uint)data.size())
810 uint lineOffset = (uint)offset;
812 while ((offset = data.find_first_of(ANTARES_MATRIX_CSV_SEPARATORS, offset))
815 assert(offset != BufferType::npos);
817 separator = data[offset];
821 converter = (
const char*)((
const char*)data.c_str() + pos);
824 if (not converter.empty())
828 if ((options & optNeverFails))
830 if (separator ==
'\n')
832 resizeWithoutDataLost(x + 1, height);
838 uint newOffset = offset;
839 uint newWidth = width + 1;
841 while ((newOffset = data.find_first_of(ANTARES_MATRIX_CSV_SEPARATORS,
842 (String::Size)newOffset))
845 if (data[newOffset] ==
'\n')
850 if (data[newOffset] !=
'\r')
856 resizeWithoutDataLost(newWidth, height);
863 if (not(options & optQuiet) and errorCount > 0)
866 <<
'`' << filename <<
"`: Invalid format: Too many entry for the row "
867 << y <<
" (offset: " << (uint)pos <<
"byte)";
870 logs.warning() <<
" ... (skipped)";
877 if (MatrixStringConverter<ReadWriteType>::direct)
882 MatrixData<T>::Copy(entry[x][y], converter);
888 if (not MatrixStringConverter<ReadWriteType>::Do(converter, cellValue))
893 if (not MatrixStringConverter<double>::Do(converter, fallback))
896 if (not(options & optQuiet) and errorCount)
899 <<
'`' << filename <<
"`: Invalid numeric value (x:" << x
900 <<
",y:" << y <<
", offset: " << (uint)pos <<
"byte), text: `"
901 << converter <<
" read:" << entry[x][y] <<
'`';
902 if (not(--errorCount))
904 logs.warning() <<
" ... (skipped)";
907 MatrixData<T>::Init(entry[x][y]);
911 entry[x][y] = MatrixRound<T, ReadWriteType>::Value(
912 static_cast<ReadWriteType
>(fallback));
918 MatrixData<T>::Copy(entry[x][y], cellValue);
927 MatrixData<T>::Init(entry[x][y]);
928 if (not(options & optQuiet))
930 logs.debug() <<
" empty value at " << (x + 1) <<
'x' << (y + 1)
931 <<
" (line offset: " << (offset - lineOffset) <<
")";
943 if (separator ==
'\r')
945 if (data[offset] ==
'\n')
953 if (separator ==
'\n')
963 if (not(options & optNeverFails))
966 if (not(options & optQuiet) and errorCount)
969 << filename <<
": at line " << (y + 1) <<
", not enough columns (expected "
970 << width <<
", got " << x <<
')';
971 if (not(--errorCount))
973 logs.warning() <<
" ... (skipped)";
979 MatrixData<T>::Init(entry[x][y]);
992 if (!(options & optQuiet))
994 logs.warning() << filename <<
": not enough rows (expected " << height <<
", got " << y
1000 for (x = 0; x < width; ++x)
1002 MatrixData<T>::Init(entry[x][y]);
1008 return ((0 != (options & optNeverFails)) ?
true : result);
1011 template<
class T,
class ReadWriteT>
1012 bool Matrix<T, ReadWriteT>::internalLoadCSVFile(
const AnyString& filename,
1019 bool result =
false;
1021 const bool hasOwnership = (NULL == buffer);
1024 buffer =
new BufferType();
1027 switch (loadFromFileToBuffer(*buffer, filename))
1029 case Yuni::IO::errNone:
1032 if (buffer->empty())
1034 if (maxHeight and minWidth)
1036 reset((minWidth != 0 ? minWidth : 1),
1048 Statistics::HasReadFromDisk(buffer->size());
1053 result = loadFromBuffer(filename,
1057 (options & optFixedSize),
1061 if (0 != (options & optMarkAsModified))
1065 jit->markAsModified();
1070 case Yuni::IO::errNotFound:
1072 if (not(options & optQuiet))
1074 logs.error() <<
"I/O Error: not found: '" << filename <<
"'";
1078 case Yuni::IO::errMemoryLimit:
1080 if (not(options & optQuiet))
1082 logs.error() << filename <<
": The file is too large (>"
1083 << (filesizeHardLimit / 1024 / 1024) <<
"Mo)";
1089 if (not(options & optQuiet))
1091 logs.error() <<
"I/O Error: failed to load '" << filename <<
"'";
1105 reset(minWidth, maxHeight);
1109 if (
JIT::enabled and not jit and (0 != (options & optFixedSize)))
1116 jit->alreadyLoaded =
true;
1117 jit->modified =
false;
1118 jit->minWidth = (options & optFixedSize) ? (!width ? minWidth : width) : 1;
1119 jit->maxHeight = height;
1120 jit->options = options;
1121 if (jit->sourceFilename.empty())
1123 jit->sourceFilename = filename;
1124 assert(not jit->sourceFilename.empty());
1133 template<
class T,
class ReadWriteT>
1136 if (width and height)
1138 for (uint x = 0; x != width; ++x)
1140 auto& column = entry[x];
1141 for (uint y = 0; y != height; ++y)
1143 if (!Utils::isZero((T)column[y]))
1153 template<
class T,
class ReadWriteT>
1154 template<
class PredicateT>
1157 if (width and height)
1159 for (uint x = 0; x != width; ++x)
1161 auto& column = entry[x];
1162 for (uint y = 0; y != height; ++y)
1164 if (!Utils::isZero((T)predicate(column[y])))
1174 template<
class T,
class ReadWriteT>
1175 template<
class PredicateT>
1178 bool print_dimensions,
1179 PredicateT& predicate,
1180 bool saveEvenIfAllZero)
const
1182 using namespace Yuni;
1187 isDecimal = Static::Type::IsDecimal<ReadWriteType>::Yes,
1190 if (not print_dimensions and (containsOnlyZero(predicate) and not saveEvenIfAllZero))
1196 matrix_to_buffer_dumper_factory mtx_to_buffer_dumper_factory;
1198 auto mtx_to_buffer_dpr = mtx_to_buffer_dumper_factory
1199 .get_dumper<T, ReadWriteT, PredicateT>(
this, data, predicate);
1202 mtx_to_buffer_dpr->set_print_format(isDecimal, precision);
1205 data.reserve(width * height * 6);
1207 if (print_dimensions)
1209 data +=
"size:" + std::to_string(width) +
'x' + std::to_string(height) +
'\n';
1212 mtx_to_buffer_dpr->run();
1215 template<
class T,
class ReadWriteT>
1216 void Matrix<T, ReadWriteT>::saveToBuffer(std::string& data, uint precision)
const
1219 this->saveToBuffer(data, precision,
false, identity,
true);
1222 template<
class T,
class ReadWriteT>
1225 if (not file.openRW(filename))
1227 logs.error() <<
"I/O error: " << filename
1228 <<
": Impossible to write the file (not enough permission ?)";
1234 template<
class T,
class ReadWriteT>
1240 template<
class T,
class ReadWriteT>
1241 template<
class PredicateT>
1242 bool Matrix<T, ReadWriteT>::internalSaveCSVFile(
const AnyString& filename,
1244 bool print_dimensions,
1245 PredicateT& predicate,
1246 bool saveEvenIfAllZero)
const
1250 jit_mgr.record_current_jit_state(width, height);
1252 if (jit_mgr.jit_activated() && jit_mgr.matrix_content_in_memory_is_same_as_on_disk())
1257 jit_mgr.clear_matrix(
this);
1261 if (jit_mgr.jit_activated() && jit_mgr.do_we_force_matrix_load_from_disk())
1263 jit_mgr.load_matrix(
this);
1268 logs.debug() <<
" :: writing `" << filename <<
"' (" << width <<
'x' << height <<
')';
1270 Yuni::IO::File::Stream file;
1271 if (not openFile(file, filename))
1276 if (height and width)
1280 saveToBuffer(buffer, precision, print_dimensions, predicate, saveEvenIfAllZero);
1281 Statistics::HasWrittenToDisk(buffer.size());
1283 saveBufferToFile(buffer, file);
1288 logs.debug() <<
" :: [end] writing `" << filename <<
"' (" << width <<
'x' << height <<
')';
1290 jit_mgr.unload_matrix_properly_from_memory(
this);
1295 template<
class T,
class ReadWriteT>
1304 if (x <= width and y <= height)
1306 for (uint i = x; i < width; ++i)
1320 uint minW = (x < copy.
width) ? x : copy.
width;
1323 for (uint i = 0; i < minW; ++i)
1327 (void)::memcpy(column, copy.
entry[i],
sizeof(T) * minH);
1329 for (uint j = minH; j < y; ++j)
1337 for (uint i = minW; i < x; ++i)
1339 Memory::Zero(y, entry[i]);
1344 for (uint i = minW; i < x; ++i)
1346 Memory::Assign(y, entry[i], defVal);
1352 logs.debug() <<
" :: end resizeWithoutDataLost";
1355 template<
class T,
class ReadWriteT>
1364 jit->options | optImmediate);
1369 template<
class T,
class ReadWriteT>
1378 if (!Utils::isZero(c))
1380 for (uint x = 0; x != width; ++x)
1384 for (uint y = 0; y != height; ++y)
1396 template<
class T,
class ReadWriteT>
1400 assert(x < width and
"Invalid column index (bigger than `this->width`)");
1402 for (uint y = 0; y != height; ++y)
1408 template<
class T,
class ReadWriteT>
1412 assert(x < width and
"Invalid column index (bigger than `this->width`)");
1413 assert(c != (T)0 &&
"Dividing by zero");
1414 ColumnType& column = entry[x];
1415 for (uint y = 0; y != height; ++y)
1421 template<
class T,
class ReadWriteT>
1424 for (uint x = 0; x != width; ++x)
1427 for (uint y = 0; y != height; ++y)
1429 col[y] = (T)std::round(col[y]);
1434 template<
class T,
class ReadWriteT>
1437 for (uint x = 0; x != width; ++x)
1440 for (uint y = 0; y != height; ++y)
1442 col[y] = std::abs(col[y]);
1447 template<
class T,
class ReadWriteT>
1451 for (uint x = 0; x != width; ++x)
1454 for (uint y = 0; y != height; ++y)
1465 template<
class T,
class ReadWriteT>
1469 for (uint x = 0; x != width; ++x)
1472 for (uint y = 0; y != height; ++y)
1483 template<
class T,
class ReadWriteT>
1484 template<
class U,
class V>
1487 assert((
void*)(&rhs) != (
void*)
this and
"Undefined behavior");
1499 for (uint x = 0; x != rhs.
width; ++x)
1501 auto& column = entry[x];
1502 const auto& src = rhs.
entry[x];
1506 if (Yuni::Static::Type::StrictlyEqual<T, U>::Yes)
1508 (void)::memcpy((
void*)column, (
void*)src,
sizeof(T) * height);
1513 for (uint y = 0; y != height; ++y)
1515 column[y] = (T)src[y];
1538 template<
class T,
class ReadWriteT>
1539 template<
class U,
class V>
1548 template<
class T,
class ReadWriteT>
1553 swap(this->width, rhs.
width);
1554 swap(this->height, rhs.
height);
1555 swap(this->entry, rhs.
entry);
1556 swap(this->jit, rhs.
jit);
1559 template<
class T,
class ReadWriteT>
1566 template<
class T,
class ReadWriteT>
1572 if (0 == width || 0 == height)
1583 rhs.
entry =
nullptr;
1587 template<
class T,
class ReadWriteT>
1595 template<
class T,
class ReadWriteT>
1598 std::cout <<
"DUMP:\n";
1601 std::cout <<
"\tempty\n";
1604 for (uint y = 0; y != height; ++y)
1607 for (uint x = 0; x != width; ++x)
1617 std::cout << entry[x][y];
1623 template<
class T,
class ReadWriteT>
1628 if (jit->alreadyLoaded and not jit->modified and not jit->sourceFilename.empty())
1631 auto& thisNotConst =
const_cast<Matrix&
>(*this);
1633 thisNotConst.
clear();
1639 template<
class T1,
class T2>
1640 bool MatrixTestForAtLeastOnePositiveValue(
const Matrix<T1, T2>& m)
1645 for (uint x = 0; x < m.
width; ++x)
1647 auto& col = m.
entry[x];
1648 for (y = 0; y < m.
height; ++y)
1660 template<
class T,
class ReadWriteT>
1665 for (uint column = 0; column != width; ++column)
1667 circularShiftRows(column, count);
1673 template<
class T,
class ReadWriteT>
1676 if (height <= 1 or !(column < width) or !(start < end))
1682 auto& values = entry[column];
1685 for (uint y = start; y < --end; ++y)
1688 values[y] = values[end];
1693 template<
class T,
class ReadWriteT>
1696 assert(column < width and
"Column out of bounds");
1697 if (height <= 1 or !(column < width) or !count)
1703 count = (count % height + height) % height;
1704 if (count == 0 or (uint) count == height)
1710 reverseRows(column, 0, count);
1711 reverseRows(column, count, height);
1712 reverseRows(column, 0, height);
1716 template<
class T,
class ReadWriteT>
1720 assert(column < width);
1721 assert(Memory::RawPointer(entry[column]));
1722 return entry[column];
1725 template<
class T,
class ReadWriteT>
1728 assert(column < width);
1729 assert(Memory::RawPointer(entry[column]));
1730 return entry[column];
1733 template<
class T,
class ReadWriteT>
1737 assert(Memory::RawPointer(entry[n]));
1741 template<
class T,
class ReadWriteT>
1745 assert(Memory::RawPointer(entry[n]));
JIT::Informations * jit
Just-in-time informations.
Definition: matrix.h:447
uint height
Height of the matrix.
Definition: matrix.h:443
void markAsModified() const
Mark the matrix as modified.
Definition: matrix.hxx:516
Matrix()
Default Constructor.
Definition: matrix.hxx:201
Matrix & operator=(const Matrix &rhs)
Assignement.
Definition: matrix.hxx:1560
bool forceReload(bool reload=false) const
Force the Load of data (if not done) for the next save and mark the matrix as modified.
Definition: matrix.hxx:374
typename Antares::Memory::Stored< uint32_t >::Type ColumnType
Column type.
Definition: matrix.h:62
bool empty() const
Get if the matrix is empty.
Definition: matrix.hxx:525
ColumnType * entry
All entries of the matrix (bidimensional array)
Definition: matrix.h:445
virtual ~Matrix()
Destructor.
Definition: matrix.hxx:275
void clear()
Empty the matrix.
Definition: matrix.hxx:531
Yuni::Clob BufferType
A buffer, for large amount of data.
Definition: matrix.h:65
uint width
Width of the matrix.
Definition: matrix.h:441
virtual bool loadFromCSVFile(const AnyString &filename, uint minWidth, uint maxHeight, uint options=optNone, BufferType *buffer=NULL)
Load entries from a CSV file.
Definition: matrix.hxx:424
static void Release(T *&pointer)
Release a raw pointer.
Definition: memory.hxx:32
static Informations * Reset(Informations *jit, const AnyString &filename)
Reset the source filename.
Definition: jit.cpp:80
static bool IsReady(Informations *j)
Get if the data has been loaded.
Definition: jit.hxx:28
static void Invalidate(Informations *j)
Mark the attached object as modified.
Definition: jit.cpp:110
static bool enabled
Flag to enable/disable JIT informations.
Definition: jit.h:179
static void MarkAsNotLoaded(Informations *j)
Mark the attached object as not loaded.
Definition: jit.cpp:101
Definition: tests-matrix-save.h:39