Comments (2)
The type should not be explicitly declared, since it isn't always going to be Int
. If you check with @code_warntype
the method is already type stable, and sometimes it will not return an Int
. For example, one might define the metric with Float64
instead of Int
.
I will have to investigate this issue more, could you provide a minimum reproducible example>
from directsum.jl.
Found it... Was my mistake after all. The code below reproduces the problem:
using ComputedFieldTypes
using StaticArrays
using Grassmann
# @basis 1
V = v1
Vec(X) = Chain{V,1,X}
Mat(X) = Chain{V,1, fulltype(Vec(X))}
function Base.rand(::Type{<:Chain{V,1,T}}) where {V, T}
D = ndims(V)
Chain{V,1}(SVector{D,T}((rand(T) for i in 1:ndims(V))...))::Chain{V,1,<:T}
end
A = rand(Mat(Float64))
x = rand(Vec(Float64))
y = A ⋅ x
Of course, I didn't intend to define V
in this way. If you remove this definition and use the @basis
instead, the problem goes away.
from directsum.jl.
Related Issues (7)
- Naming conventions in DirectSum for v0.3+
- Ambiguous Base.:(==) in the doc of ℝ HOT 1
- Generic constructor fails for Signature "-+" HOT 4
- Support arbitrary metrics HOT 4
- Trouble creating an array of unit vectors when one of them has negative scalar coefficient HOT 2
- Trouble with @basis macro and D constructor HOT 4
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 directsum.jl.