Comments (9)
The code to generate the types and operations is mostly past the horizon of my own metaprogramming skills, so I can't jibble with it much.
from oldimmutablearrays.jl.
There will still probably need to be tweaking of exactly which binary operators are defined, and how, but that task should be a bit more accessible to all now.
from oldimmutablearrays.jl.
This gives me a kilometer of ambiguity warnings when using the package, and division still doesn't work.
julia> using ImmutableArrays
Warning: New definition
+(Vector2{T},T) at /Users/owilkman/.julia/ImmutableArrays/src/ImmutableArrays.jl:75
is ambiguous with
+(T,Vector2{T}) at /Users/owilkman/.julia/ImmutableArrays/src/ImmutableArrays.jl:71.
Make sure
+(Vector2{T},Vector2{T})
is defined first.
[something like 50 of these warnings]
julia> a = Vector3{Float64}(0.1, 0.2, 0.3)
3-element Float64 Vector3:
0.1
0.2
0.3
julia> a / 3
ERROR: no method ./(Vector3{Float64},Int64)
in / at abstractarray.jl:260
julia> a / 3.0
ERROR: no method ./(Vector3{Float64},Float64)
in / at abstractarray.jl:260
from oldimmutablearrays.jl.
The warnings can be eliminated by commenting out one of the left or right applications of the scalar. This is also an issue, for instance, for the DataFrames package. There is currently no way to supress warnings.
from oldimmutablearrays.jl.
Methods that apply automatic coersions for scalars of mixed type can be added but will require a further generalization of the method definition functions to allow for specifying a second scalar type.
from oldimmutablearrays.jl.
I generalized the type of the scalar argument to Number. This had the benefit of both suppressing the warnings and causing the new test script to pass without complaint. Hopefully the JIT compilation will ensure that we don't loose any performance.
from oldimmutablearrays.jl.
Last night I was very bored, but not in a very creative mood, so I took the trouble of writing an immutable array package up to size 4 completely explicitly: https://github.com/dronir/MyLittleArray
I probably won't develop it any further, and it may have bugs, but I'll use it to compare to the generated code we have here. I'm slightly surprised that with that latest change, ImmutableArrays.jl actually even has slightly better performance than MyLittleArray.
from oldimmutablearrays.jl.
@dronir : It may be useful to have your hand-coded library (or some version of it) in the test suite to test for semantic or performance regressions. Thanks again for your contributions.
from oldimmutablearrays.jl.
This project is dear to me, because most of what I do are things where these immutable arrays are usually very good.
from oldimmutablearrays.jl.
Related Issues (20)
- Add WYSIWYG Matrix constructor HOT 3
- Arrays of rank 3 or higher. HOT 1
- randmatstat benchmark
- construct, convert from native Julia arrays HOT 1
- Ambiguous definitions with MathConst HOT 1
- Error when running PackageEvaluator HOT 1
- inv(Matrix4x4) not working HOT 4
- Ambiguous Definitions in Julia 0.3 HOT 4
- Add Gaussian elimination HOT 1
- unrolled det/inv
- getindex definition HOT 1
- Incorrect type conversion for ImmutableArrays HOT 1
- Matrix4x4 * AbstractVector{Vector4} HOT 4
- Array conversion error HOT 1
- Tag a new version? HOT 2
- Support exponentiation of immutable matrices HOT 3
- Benchmark script is missleading.
- Deprecation? HOT 5
- WARNING: Base.MathConst is deprecated, use Base.Irrational instead HOT 1
- Info about upcoming removal of packages in the General registry
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oldimmutablearrays.jl.