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

8 messages
Open this post in threaded view
|
Report Content as Inappropriate

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

 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.
Open this post in threaded view
|
Report Content as Inappropriate

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

 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),
Open this post in threaded view
|
Report Content as Inappropriate

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

 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.
Open this post in threaded view
|
Report Content as Inappropriate

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

 We already have (unexported) PermutedDimsArray, so your RowVector already exists.Best,--TimOn Fri, Sep 30, 2016 at 12:51 PM, 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.
Open this post in threaded view
|
Report Content as Inappropriate

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

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

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

 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 wrote:Does a PermutedDimsArray-style RowVector really behave like a RowVector? Specifically product with a normal vector to a scalar?
Open this post in threaded view
|
Report Content as Inappropriate

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

 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.