library to solve the system of linear equations
Yura
yuriy.min at gmail.com
Fri Oct 14 21:38:45 UTC 2022
On Friday, 14 October 2022 at 18:37:00 UTC, Sergey wrote:
> On Friday, 14 October 2022 at 17:41:42 UTC, Yura wrote:
>> Dear All,
>>
>> I am very new to D, and it has been a while since I coded in
>> anything than Python. I am using just notepad along with the
>> gdc compiler.
>>
>> At the moment I need to solve the system of liner equations:
>>
>> A00*q0 + A01*q1 + A02*q2 ... = -V0
>> A10*q0 + A11*q1 + A12*q2 ... = -V1
>> ...
>>
>> Could someone please provide a quick d solution for this,
>> including details on how to install the library & link it to
>> the code? I do not need anything advanced, just the easiest
>> option.
>>
>> I am sorry for too basic question, just want to check my idea
>> quickly. Thank you!
>
> Firstly I will suggest to install dub - the D package manager.
> It will be easier to isntall other libraries using it.
>
> Install openblas in your Ubuntu system. After that you can
> create a new folder and type in terminal
> ```
> dub init
> ```
>
> The main part will be about "dependencies". Type "lubeck".
> After that you could check the example of the simple program
> here:
> https://github.com/kaleidicassociates/lubeck/blob/master/example/source/app.d
>
> It is exactly solving simple system of linear equations.
> Link to the package where you can find additional details and
> documentation: https://code.dlang.org/packages/lubeck
Thank you!
First, I installed dub on Linux. Then I installed both
libopenblas-dev and libopenblas-base.
After that I tried to initiate a new project via dub init. I
tried to use the following dependency:
"mir-algorithm". After I got dub.sdl file that contains at the
end line:
dependency "mir-algorithm" version="~>3.16.12"
in the top of my el.d file I have:
/+dub.sdl:
dependency "mir-algorithm" version="~>3.16.12"
+/
import std.stdio;
import std.string;
import std.conv;
import std.exception : assertThrown;
import std.math;
import mir.ndslice;
however, when I try to compile it (gdc el.d) it gives me the
following error message:
el.d:11:8: error: module ndslice is in file 'mir/ndslice.d' which
cannot be read
import mir.ndslice;
^
import path[0] = /usr/lib/gcc/x86_64-linux-gnu/8/include/d
What am I doing wrong? Should I specify the library upon
compilation?
I am sorry, I am feeling I am asking too basic question.
Thank you!
More information about the Digitalmars-d-learn
mailing list