Convert strings to double (TCplx) and store them in the Values array.
#
Name
Type
Description
1
aList
tStrings *
2
Delimiter = kTab
const DewString &
Remarks:
Convert strings in aList to double (real number) and store them in the Values array of the calling matrix. Matrix::Rows property is set to aList.Count. Matrix::Complex and Matrix::Cols propertes are auto-detected. Complex numbers must follow the format: a+bi. All strings must have the same number of columns (numbers). Columns must be separated with a Delimiter. By default the delimiter is the tab charachter.
Examples
#include "MtxStrings.h"
#include "MtxExpr.h"
#include "Units.MtxExpr.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxExpr;
void Example()
{
Matrix a, b;
tStringList* Lines;
a.SetIt(2, 2, false, DewArray<double>{1, 2, 3, 4});
b.Size(a);
b.SetVal(1);
a = Cos(a) + b;
Lines = new tStringList();
a.ValuesToStrings(Lines);
b.ValuesToStrings(Lines);
Lines->SaveToFile("Test.txt");
Lines->LoadFromFile("Test.txt");
a.StringsToValues(Lines);
delete Lines;
}
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler
Overload 4: TMtx *StringsToValues(tStrings *aList, int ListIndex, int ListLen, int Row, int Col, DewString Delimiter = kTab) const;
Convert strings from [ListIndex]..[ListIndex+ListLen-1] in aList to double (TCplx).
#
Name
Type
Description
1
aList
tStrings *
2
ListIndex
int
3
ListLen
int
4
Row
int
5
Col
int
6
Delimiter = kTab
DewString
Remarks:
Store them in the Values array of the calling matrix, starting from element [Row,Cols]. The size of the calling matrix is not changed. If array bounds are overrun an exception is raised. Complex numbers must follow the format: a+bi.
Examples
#include "MtxStrings.h"
#include "MtxExpr.h"
#include "Units.MtxExpr.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxExpr;
void Example()
{
Matrix a, b;
tStringList* Lines;
Lines = new tStringList();
a = {{1, 2}, {3, 4}};
b.Size(a);
b.SetVal(1);
a = Cos(a) + b;
Lines->Clear();
a.ValuesToStrings(Lines);
b.ValuesToStrings(Lines);
Lines->SaveToFile("Test.txt");
Lines->LoadFromFile("Test.txt");
a.StringsToValues(Lines);
delete Lines;
}
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler