Skip to content
This repository was archived by the owner on Dec 10, 2018. It is now read-only.

Conversation

kortschak
Copy link
Member

@btracey / @vladimir-ch Please take a look.

@vladimir-ch
Copy link
Member

For my better understanding: why is it stale?

@kortschak
Copy link
Member Author

I need to think more about this.

@kortschak
Copy link
Member Author

OK. Done thinking. It's clear that we have decided that Clone is something that does not preserve the receiver's state in any way (for better or worse). The original design in my head when I started the shadowing code was to engineer safe work places when there was shadowing. On discussion with @btracey we decided that restriction was more sensible. The TODO here was written when overlap detection would have allowed Clone to work somewhere else in case of an overlap. That can't happen anymore.

I'll add some extra documentation to Cloner and Dense.Clone, and I also will add the *Vector path.

@kortschak kortschak force-pushed the shadow-doc branch 2 times, most recently from af65cc5 to a2fec3a Compare March 11, 2016 01:42
}
case *Vector:
amat := aU.mat
mat.Data = make([]float64, aU.n)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more question: the default case reuses the slice because there is no way (unlike with *Vector or RawMatrixer) that such matrix could shadow a Dense, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually could if someone constructed it that way. A matrix that stores its elements in a blas64.General but does not have a RawMatrix method would allow this. Probably I should allocate a new slice there since I am now saying that Clone will not cause shadowing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable and consistent, and reduces my doubt.

This is now covered in the package level documentation and addressed in
code.
@vladimir-ch
Copy link
Member

LGTM

@kortschak kortschak merged commit 05edb49 into master Mar 11, 2016
@kortschak kortschak deleted the shadow-doc branch March 15, 2016 23:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants