Plan for special array types (RowVector, Fill, Identity)?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Plan for special array types (RowVector, Fill, Identity)?

Sheehan Olver

Is there a plan to eventually add special types for any of the following:

1) RowVector: represent a row vector, with the property that RowVector([1,2,3])*[1,2,3] = 14  
2) Fill(x,n,m): represent an n x m matrix of all entries equal to x in O(1) memory. 
3) Identity(T,n,m): represent an n x m identity matrix in O(1) memory.  (Probably better as UniformScalingMatrix to support constants other than 1)

I think I will need these to handle matrices of operators in ApproxFun efficiently, but wanted to know whether to hold off for 0.6 or start rolling this on my own.  One option would be to put together a package with these special types, say JuliaMatrices/StructuredMatrices.jl, which could eventually be merged into Base.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Plan for special array types (RowVector, Fill, Identity)?

Andy Ferris
Of course, there is the "taking vector transposes seriously" issue for the RowVector. 

Fill and Identity (with size) seem like good additions, but there's no harm in adding such things outside of Base unless they might be good replacement return types for some functions already in Base (I understand LinAlg might even be spun off to a "standard library" package with a more compact "Base" module),
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Plan for special array types (RowVector, Fill, Identity)?

David P. Sanders
In reply to this post by Sheehan Olver


El jueves, 29 de septiembre de 2016, 4:14:51 (UTC+2), Sheehan Olver escribió:

Is there a plan to eventually add special types for any of the following:

1) RowVector: represent a row vector, with the property that RowVector([1,2,3])*[1,2,3] = 14  
2) Fill(x,n,m): represent an n x m matrix of all entries equal to x in O(1) memory. 
3) Identity(T,n,m): represent an n x m identity matrix in O(1) memory.  (Probably better as UniformScalingMatrix to support constants other than 1)

UniformScaling already exists (with that name).
Could you explain the purpose of Fill? 
 

I think I will need these to handle matrices of operators in ApproxFun efficiently, but wanted to know whether to hold off for 0.6 or start rolling this on my own.  One option would be to put together a package with these special types, say JuliaMatrices/StructuredMatrices.jl, which could eventually be merged into Base.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Plan for special array types (RowVector, Fill, Identity)?

Tim Holy
We already have (unexported) PermutedDimsArray, so your RowVector already exists.

Best,
--Tim

On Fri, Sep 30, 2016 at 12:51 PM, David P. Sanders <[hidden email]> wrote:


El jueves, 29 de septiembre de 2016, 4:14:51 (UTC+2), Sheehan Olver escribió:

Is there a plan to eventually add special types for any of the following:

1) RowVector: represent a row vector, with the property that RowVector([1,2,3])*[1,2,3] = 14  
2) Fill(x,n,m): represent an n x m matrix of all entries equal to x in O(1) memory. 
3) Identity(T,n,m): represent an n x m identity matrix in O(1) memory.  (Probably better as UniformScalingMatrix to support constants other than 1)

UniformScaling already exists (with that name).
Could you explain the purpose of Fill? 
 

I think I will need these to handle matrices of operators in ApproxFun efficiently, but wanted to know whether to hold off for 0.6 or start rolling this on my own.  One option would be to put together a package with these special types, say JuliaMatrices/StructuredMatrices.jl, which could eventually be merged into Base.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Plan for special array types (RowVector, Fill, Identity)?

Andy Ferris
Does a PermutedDimsArray-style RowVector really behave like a RowVector? Specifically product with a normal vector to a scalar?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Plan for special array types (RowVector, Fill, Identity)?

Tim Holy
It behaves like "regular" 1xn arrays, meaning the result of that multiplication will be a 1x1 Array, not a scalar.

On Fri, Sep 30, 2016 at 4:15 PM, Andy Ferris <[hidden email]> wrote:
Does a PermutedDimsArray-style RowVector really behave like a RowVector? Specifically product with a normal vector to a scalar?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Plan for special array types (RowVector, Fill, Identity)?

Sheehan Olver
In reply to this post by David P. Sanders
UniformScaling doesn't include the dimension of the matrix.

On Saturday, October 1, 2016 at 3:51:55 AM UTC+10, David P. Sanders wrote:


El jueves, 29 de septiembre de 2016, 4:14:51 (UTC+2), Sheehan Olver escribió:

Is there a plan to eventually add special types for any of the following:

1) RowVector: represent a row vector, with the property that RowVector([1,2,3])*[1,2,3] = 14  
2) Fill(x,n,m): represent an n x m matrix of all entries equal to x in O(1) memory. 
3) Identity(T,n,m): represent an n x m identity matrix in O(1) memory.  (Probably better as UniformScalingMatrix to support constants other than 1)

UniformScaling already exists (with that name).
Could you explain the purpose of Fill? 
 

I think I will need these to handle matrices of operators in ApproxFun efficiently, but wanted to know whether to hold off for 0.6 or start rolling this on my own.  One option would be to put together a package with these special types, say JuliaMatrices/StructuredMatrices.jl, which could eventually be merged into Base.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Plan for special array types (RowVector, Fill, Identity)?

Andreas Noack
Can you give an example of where you need the dimension of the UniformScaling?

On Fri, Sep 30, 2016 at 7:17 PM, Sheehan Olver <[hidden email]> wrote:
UniformScaling doesn't include the dimension of the matrix.


On Saturday, October 1, 2016 at 3:51:55 AM UTC+10, David P. Sanders wrote:


El jueves, 29 de septiembre de 2016, 4:14:51 (UTC+2), Sheehan Olver escribió:

Is there a plan to eventually add special types for any of the following:

1) RowVector: represent a row vector, with the property that RowVector([1,2,3])*[1,2,3] = 14  
2) Fill(x,n,m): represent an n x m matrix of all entries equal to x in O(1) memory. 
3) Identity(T,n,m): represent an n x m identity matrix in O(1) memory.  (Probably better as UniformScalingMatrix to support constants other than 1)

UniformScaling already exists (with that name).
Could you explain the purpose of Fill? 
 

I think I will need these to handle matrices of operators in ApproxFun efficiently, but wanted to know whether to hold off for 0.6 or start rolling this on my own.  One option would be to put together a package with these special types, say JuliaMatrices/StructuredMatrices.jl, which could eventually be merged into Base.

Loading...