Given an expression x, are the following two statements interchangable with no exceptions?
Depth[x] - 1 == 2x // MatrixQ
If they are, which is evaluated faster? Other than for speed, is there a reason one should be used rather than the other?
|
Given an expression
If they are, which is evaluated faster? Other than for speed, is there a reason one should be used rather than the other? |
||||
| show 3 more comments |
|
I think you might be confused about what they both do. While it's true that a matrix with only numerical entries will give
I can't say for certain what you are using this for, but I'd bet that you want |
|||
|
|
Timing– jVincent Dec 21 '12 at 20:47DepthandMatrixQfell into the latter category and coupled with the lack of reasoning, it was NaRQ (which is what @whuber was saying above). Note that the==2part was added later by Istvan in what is a major change to the question and was not made by the OP (there are no deleted comments by the OP either). So the original closure was fully justified. I've reopened this now, because for good or for bad, Istvan's edit + your interpretation makes a compelling case for a possible source of confusion and thus is a worthy question. – rm -rf♦ Dec 22 '12 at 9:03