Revert "Added len function to Matrix"

This reverts commit 37db22bca8.
This commit is contained in:
Andrew Kane
2021-10-26 01:22:29 -07:00
parent 37db22bca8
commit e28f8053cc
2 changed files with 0 additions and 16 deletions

View File

@@ -1,7 +1,3 @@
## 0.2.1 (unreleased)
- Added `len` function to `Matrix`
## 0.2.0 (2021-10-17) ## 0.2.0 (2021-10-17)
- Added support for Windows - Added support for Windows

View File

@@ -23,10 +23,6 @@ impl Matrix {
self.data.push(MfNode { u: row_index, v: column_index, r: value }); self.data.push(MfNode { u: row_index, v: column_index, r: value });
} }
pub fn len(&self) -> usize {
self.data.len()
}
pub(crate) fn to_problem(&self) -> MfProblem { pub(crate) fn to_problem(&self) -> MfProblem {
let data = &self.data; let data = &self.data;
let m = data.iter().map(|x| x.u).max().unwrap_or(-1) + 1; let m = data.iter().map(|x| x.u).max().unwrap_or(-1) + 1;
@@ -56,12 +52,4 @@ mod tests {
let mut data = Matrix::with_capacity(1); let mut data = Matrix::with_capacity(1);
data.push(0, 0, 1.0); data.push(0, 0, 1.0);
} }
#[test]
fn test_len() {
let mut data = Matrix::new();
assert_eq!(data.len(), 0);
data.push(0, 0, 1.0);
assert_eq!(data.len(), 1);
}
} }