The core types and functions of the SciNim ecosystem
scinim / numericalnim Goto Github PK
View Code? Open in Web Editor NEWA collection of numerical methods written in Nim
Home Page: https://scinim.github.io/numericalnim/
License: MIT License
A collection of numerical methods written in Nim
Home Page: https://scinim.github.io/numericalnim/
License: MIT License
Now that we finally have a documentation you can really see what procs are documented and which are not.
It could also be nice with a paragraph at the top of each module as well to describe what it provides and recommended methods.
Many thanks for this very interesting package.
I've tried the examples in your documentation.
The following CubicSpline example does not compile on my Nim (devel)
import numericalnim
var X = @[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0] # seconds
var Y = @[0.0, 4.0, 6.0, 6.5, 6.4, 6.2, 0.0] # meters/second
let spline = newCubicSpline(X, Y)
echo spline.eval(5.0)
#[
NumNim_BUG.nim(6, 6) template/generic instantiation from here
$HOME/.nimble/pkgs/numericalnim-0.6.0.1/numericalnim/interpolate.nim(182, 27) Error: cannot instantiate: 'T'
]#
Nim Compiler Version 1.5.1 [Linux: amd64]
Compiled at 2021-01-07
Copyright (c) 2006-2020 by Andreas Rumpf
git hash: 89a21e4ec71e705833d2aacd069e291cf41a19c6
active boot switches: -d:release
I need to separate the internal util procs I'm using and the ones like Vector
which should be exported to the user. I should possibly rename the exported module something more descriptive than utils
as well :P
If there are duplicates in x-value in a dataset there are two scenarios:
While we are at it we should also revamp sortDataset
to accept a variable number of input arrays. Should we use array[N: static int, seq[T]]
as both input and output then? Nah I'll just do varargs[seq[T]]
and sort along the first sequence only and keep track of the indices for the rest. That should be efficient enough. T prepare for VectorLike
I should probably not use varargs
though, will go with openarray
.
var ptsCoord = newSeq[array[2, float]]()
# corners
ptsCoord.add([-200.0,-150.0])
ptsCoord.add([-200.0,150.0])
ptsCoord.add([200.0,-150.0])
ptsCoord.add([200.0,150.0])
var ptsValue = @[0.0,1.0,4.0,5.0]
# extra pts
ptsCoord.add([0.0,-150.0])
ptsCoord.add([0.0,150.0])
ptsCoord.add([0.0,0.0])
ptsValue.add(8.0)
ptsValue.add(1.0)
ptsValue.add(1.0)
let bary = newBarycentric2D(ptsCoord.toTensor(), ptsValue.toTensor())
Compiled with nim cpp --gc:arc with Nim 1.6.0
It seems related to Vector2 in cdt
Stage 1: Improve the error messages (specifically trimAndSortDataset
)
Stage 2: improve error handling. Some universal @SciNim way of reporting back non-fatal error to the user. For example that the maximum number of iterations was reached.
numericalnim/src/numericalnim/integrate.nim
Line 420 in 614cb30
if this nim-lang/Nim#20412 get merged, it will be a problem.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.