Hi,
I'm going circles... ;) I read a string that contains an array of
unknown dimension like:
a = [1,2,3,4] or
a = [[1,2],[3,4]] or
a = [[[1,2],[3,4]],[[5,6],[7,8]]]
With that I want to perform specified operations e.g. also
provided on command line.
Because at compile time the dimension
Thanks for all the insights :)
On Sunday, 18 February 2018 at 12:51:04 UTC, thorstein wrote:
Thank you for the very informative answers showing different
gears in D!
However, there are still some details I'm struggling with:
Assume some calculations on a very big numeric array
'double[][][] arr'.
Now we could choose 1
Thank you for the very informative answers showing different
gears in D!
However, there are still some details I'm struggling with:
Assume some calculations on a very big numeric array
'double[][][] arr'.
Now we could choose 1 out of 3 different implementations:
// Solution 1
foreach(row;
Hello,
This was my goal:
-
public double[][] skalar_m_2d(double[][] array, double skalar)
{
return array.map!(b => b[].map!(c => c * skalar));
}
!!! But: return value is not double!
Type check for return value:
a = array.map!(b => b[].map!(c => c
Hi,
I get the following compile error with this function below:
source\mod_data\matrices.d(66,12): Error: cannot implicitly
convert expression (j) of type ulong to uint
(66,12) is [j] in row[j]
Using uint as type for rows, cols (i.e. the indices) works. Is
ulong not allowed for array
Replace
arrayT ~= rowT;
with
arrayT ~= rowT.dup;
Also, you may want to look into ndslice package [1].
[1] https://github.com/libmir/mir-algorithm
Best regards,
Ilya Yaroshenko
Works! Thanks Ilya. I'll take a look on the difference. Also soon
will get bit familiar with the mir-algorithm...
Guyes, I obviously made a mistake. Forget my post!
Sorry, I'm still really confused with the results from my
function:
double[][] transp(double[][] array)
{
double[][] arrayT;
double[] rowT;
// initialize rowT
foreach(i; 0..array.length)
{
rowT ~= 0;
}
foreach(col;
On Sunday, 1 October 2017 at 13:53:57 UTC, thorstein wrote:
Why is that
Thanks!
Guyes, I obviously made a mistake. Forget my post!
They are not alternatives. They are the only way of doing
things.
Yes, sounds logic - static arrays require a size before
compilation.
However, I tried another variation with a totally unexpected
result:
double[][] transp3(double[][] array)
{
double[][] arrayT;
double[] rowT;
//
Hi,
assumed, I need the size of a dynamic array for further
processing, which is unknown at compile time. Below are my
example, which doesn't work and two alternatives.
Alternative1: may create large rowT-arrays depending on original
array size.
Alternative2: overrides rowT after exiting the
Ups, somehow overread the last sentence of tourge :)
Thanks for the detailed insights!
Thanks to all, I got it!
I created a new dub package and copied my code there. Compiles.
So I guess I get the rest working as well.
Still will have to figure out later the procedure to do the same
for a VisualD project, if it is possible.
Thorstein
Hi,
I have questions regarding the usage of 'dub'. I'm learning D
under Win7. I have installed VisualD for the community edition of
Visual Studio and got some file i/o working.
Next I would like to continue with the mir-tools for matrix
manipulation. I understood that I have to build them
On Sunday, 26 February 2017 at 21:50:38 UTC, Jordan Wilson wrote:
auto readNumMatCsv2 (string filePath, string ndv, string
new_ndv){
double[][] p_numArray;
try {
auto lines = File(filePath,"r").byLine;
lines.popFront; // get read of header
p_numArray =
I really appriciate your comments and thoughts!
On Sunday, 26 February 2017 at 21:02:52 UTC, ag0aep6g wrote:
On Sunday, 26 February 2017 at 19:34:33 UTC, thorstein wrote:
* "no-data-value"?
No-data-values in data sets are common at least in geosciences:
raster images, spatial simulation
Hi,
sorry for posting again, but I used a keyboard combination that
accidently send my post before it was done.
Coming more or less from Python I just started with D. Not a real
programmer, just automating things and looking for a neat
compiled language.
Just to learn, I wrote a function
Hi,
coming more or less from Python I just started with D. Not a real
programmer, just automating things and looking for a neat
compiled language.
Just to learn, I wrote a function to read CSV-like files (I know
D has its own routine). Since I'm still a bit overwhelmed by the
many complex
18 matches
Mail list logo