-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Triangular: no implementation of similar
, setindex!
#6838
Comments
Initially, By the way, I can see that |
Isn't |
Depends on what you mean by immutable. Do you mean that the type is an immutable Julia type? Or that it is immutable-by-convention like strings? |
However, I see another problem here. How should we handle the situation when someone tries to set an element in the zero part of the matrix? An error, just ignore it since it doesn't change anything or return a non- |
Yes, that's the only reasonable thing to do. I think we should allow changing the parts of these special kinds of matrices that can be modified because someone who knows what they're doing may want to do that – and it's often easier to modify a diagonal or off-diagonal element using matrix coordinates than trying to reach in and change the underlying arrays directly. |
@JeffBezanson didn't like the idea of |
I'm not suggesting changing the type of an object – you can't do that. The definition of immutable Triangular{T<:Number} <: AbstractMatrix{T}
UL::Matrix{T}
uplo::Char
unitdiag::Char
end The fact that |
@StefanKarpinski I think that would be the best solution for @timholy How far are you in this implementation? I have a rewrite of |
I haven't even had a chance to start yet, so do go ahead. |
Setting |
I didn't manage to write what I had in mind. A |
Ah, that makes more sense. I do think that |
Hopefully this is the right place for this. Was |
Not yet julia> methods(setindex!, (Symmetric,))
0-element Array{Any,1} PRs to implement |
Could you give me an idea of where to start. I would be happy to work on it, although I am fairly new to the language. EDIT: So, I found symmetric.jl I think this is the right place. I'll start there and try to use ffc9778 as a template. |
@bisraelsen Could you sketch how you think |
I only meant to use the I had planned only on allowing changes that maintain symmetry. For example if someone changes index |
I had code that looked like this:
This broke when
chol
started returning aTriangular
type. I started to implementsimilar
forTriangular
(creating anotherTriangular
type), but then noticed there is nosetindex!
. Since the next thing my code did was stuff some values inX
, that would fail.So before doing anything, I should ask: is the omission of
setindex!
deliberate?The text was updated successfully, but these errors were encountered: