Comments (3)
This is how to define sqrt
for grade 0 values (and indexbasis
would not be used for that):
Base.sqrt(x::SValue{V,0}) where V = sqrt(value(x))*basis(x)
The difference between MValue
and SValue
is that M
stands for mutable and S
for static.
from grassmann.jl.
Ah, right, since grade 0 already defines the scalar base vector I don't have to check for that! Thanks!
from grassmann.jl.
More generally, you can define this method for Basis,SValue,MValue
simultaneously with TensorTerm
Base.sqrt(x::T) where T<:TensorTerm{V,0} where V = sqrt(value(x))*basis(x)
since TensorTerm
has Basis,SValue,MValue
as a subtypes
julia> subtypes(TensorTerm{ℝ^2,0})
3-element Array{Any,1}:
Basis{⟨++⟩,0,B} where B
MValue{⟨++⟩,0,B,T} where T where B
SValue{⟨++⟩,0,B,T} where T where B
from grassmann.jl.
Related Issues (20)
- Question: Extracting floating point values from coefficients HOT 2
- grade selection syntax HOT 6
- Renaming functions / API redesign for v1.0 HOT 2
- (log ∘ exp) gives strange output HOT 8
- Weird output for G3 HOT 2
- 3D vector fields don't plot correctly HOT 3
- Errors with symbolic coefficients, mixed-grades multivectors / operators related ? (both Reduce and SymEngine) HOT 4
- streamplot example in README got inv(...) is undefined HOT 4
- Confusion about mixed grade contraction HOT 4
- Incorrect geometric square `(v12 + v34)^2`. HOT 1
- Error processing example in README (Makie upgrade) HOT 5
- Calculating a Perpendicular Vector in Basis 2 HOT 2
- gradient throws error HOT 7
- Grassmann.jl software design discussion now private
- Reversion operator (~) is not defined for Symbolic Coefficients when using Grassmann and Reduce HOT 1
- stackoverflow on broadcast HOT 3
- ERROR: LoadError: MethodError: no method matching parityrighthodge(::Int64, ::UInt64)
- Unknown symbol in 5D CGA Basis HOT 1
- Inner Product between vector and bivector HOT 4
- Geometric Product between Bivectors of 5D CGA HOT 1
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 grassmann.jl.