-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cosmetic changes - [x] from `Var` and `Conj` to `Val` types (compatibility with Julia), - [x] from `is` to `===` due to deprecations, - [x] from `typealias` to `const ...` due to deprecations, - [x] in Plots and GR versions to pass tests.
- Loading branch information
Arda Aytekin
committed
Feb 27, 2017
1 parent
bce8961
commit 9bd8db2
Showing
7 changed files
with
117 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
# Relation with itself | ||
promote_rule{T,S,U1,V1,U2,V2}(::Type{RationalFunction{Var{T},Conj{S},U1,V1}}, | ||
::Type{RationalFunction{Var{T},Conj{S},U2,V2}}) = | ||
RationalFunction{Var{T},Conj{S},promote_type(U1,U2),promote_type(V1,V2)} | ||
convert{T,S,U1,V1,U2,V2}(::Type{RationalFunction{Var{T},Conj{S},U1,V1}}, | ||
r::RationalFunction{Var{T},Conj{S},U2,V2}) = | ||
RationalFunction(convert(Poly{U1}, r.num), convert(Poly{V1}, r.den), Conj{S}) | ||
convert{T,S,U,V}(::Type{RationalFunction{Var{T},Conj{S},U,V}}, | ||
r::RationalFunction{Var{T},Conj{S},U,V}) = r | ||
promote_rule{T,S,U1,V1,U2,V2}(::Type{RationalFunction{Val{T},Val{S},U1,V1}}, | ||
::Type{RationalFunction{Val{T},Val{S},U2,V2}}) = | ||
RationalFunction{Val{T},Val{S},promote_type(U1,U2),promote_type(V1,V2)} | ||
convert{T,S,U1,V1,U2,V2}(::Type{RationalFunction{Val{T},Val{S},U1,V1}}, | ||
r::RationalFunction{Val{T},Val{S},U2,V2}) = | ||
RationalFunction(convert(Poly{U1}, r.num), convert(Poly{V1}, r.den), Val{S}) | ||
convert{T,S,U,V}(::Type{RationalFunction{Val{T},Val{S},U,V}}, | ||
r::RationalFunction{Val{T},Val{S},U,V}) = r | ||
|
||
# Relation with numbers | ||
promote_rule{T,S,U,V,Y<:Number}(::Type{RationalFunction{Var{T},Conj{S},U,V}}, ::Type{Y}) = | ||
RationalFunction{Var{T},Conj{S},promote_type(U,Y),V} | ||
convert{T,S,U,V}(::Type{RationalFunction{Var{T},Conj{S},U,V}}, n::Number) = | ||
RationalFunction(Poly(U[n], T), Poly([one(V)], T), Conj{S}) | ||
promote_rule{T,S,U,V,Y<:Number}(::Type{RationalFunction{Val{T},Val{S},U,V}}, ::Type{Y}) = | ||
RationalFunction{Val{T},Val{S},promote_type(U,Y),V} | ||
convert{T,S,U,V}(::Type{RationalFunction{Val{T},Val{S},U,V}}, n::Number) = | ||
RationalFunction(Poly(U[n], T), Poly([one(V)], T), Val{S}) | ||
|
||
# Relation with polynomials | ||
promote_rule{T,S,U,V,Y<:Number}(::Type{RationalFunction{Var{T},Conj{S},U,V}}, | ||
::Type{Poly{Y}}) = RationalFunction{Var{T},Conj{S},promote_type(U,Y),V} | ||
function convert{T,S,U,V}(::Type{RationalFunction{Var{T},Conj{S},U,V}}, p::Poly) | ||
promote_rule{T,S,U,V,Y<:Number}(::Type{RationalFunction{Val{T},Val{S},U,V}}, | ||
::Type{Poly{Y}}) = RationalFunction{Val{T},Val{S},promote_type(U,Y),V} | ||
function convert{T,S,U,V}(::Type{RationalFunction{Val{T},Val{S},U,V}}, p::Poly) | ||
newpoly = convert(Poly{U}, p) | ||
RationalFunction(newpoly, Poly([one(V)], T), Conj{S}) | ||
RationalFunction(newpoly, Poly([one(V)], T), Val{S}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.