1 // Copyright ©2015 The Gonum Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 // Iladlc scans a matrix for its last non-zero column. Returns -1 if the matrix
10 // Iladlc is an internal routine. It is exported for testing purposes.
11 func (Implementation) Iladlc(m, n int, a []float64, lda int) int {
15 checkMatrix(m, n, a, lda)
17 // Test common case where corner is non-zero.
18 if a[n-1] != 0 || a[(m-1)*lda+(n-1)] != 0 {
22 // Scan each row tracking the highest column seen.
24 for i := 0; i < m; i++ {
25 for j := n - 1; j >= 0; j-- {
27 highest = max(highest, j)