Metadata-Version: 2.4
Name: testupackage
Version: 0.1.0
Summary: A Python package for matrix operations (transpose, multiply, inverse, rank)
Project-URL: Homepage, https://github.com/yourusername/testup_package
Project-URL: Repository, https://github.com/yourusername/testup_package
Author-email: Your Name <884456850@qq.com>
License: MIT
Keywords: linear-algebra,math,matrix,numpy
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.8
Requires-Dist: numpy
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# testup_package

A Python package for matrix operations.

## Features

- Matrix transpose
- Matrix multiplication
- Matrix inverse
- Matrix rank

## Installation

```bash
pip install testupackage
```

Or install from source:

```bash
git clone https://github.com/yourusername/testup_package.git
cd testup_package
pip install -e .
```

## Usage

```python
from testup_package import transpose, matrix_multiply, inverse, rank

# Matrix transpose
m = [[1, 2, 3], [4, 5, 6]]
print(transpose(m))
# [[1. 4.]
#  [2. 5.]
#  [3. 6.]]

# Matrix multiplication
a = [[1, 2], [3, 4]]
b = [[5, 6], [7, 8]]
print(matrix_multiply(a, b))
# [[19. 22.]
#  [43. 50.]]

# Matrix inverse
m = [[1, 2], [3, 4]]
print(inverse(m))
# [[-2.   1. ]
#  [ 1.5 -0.5]]

# Matrix rank
print(rank([[1, 2], [2, 4]]))  # 1 (singular matrix)
print(rank([[1, 0], [0, 1]]))  # 2 (full rank)
```

## API Reference

### `transpose(matrix)`

Return the transpose of a matrix.

- **Parameters:** `matrix` - Input matrix (list of lists or numpy array)
- **Returns:** Transposed matrix as numpy array

### `matrix_multiply(a, b)`

Multiply two matrices.

- **Parameters:** `a`, `b` - Input matrices
- **Returns:** Product matrix as numpy array
- **Raises:** `ValueError` if dimensions are incompatible

### `inverse(matrix)`

Return the inverse of a square matrix.

- **Parameters:** `matrix` - Square matrix to invert
- **Returns:** Inverse matrix as numpy array
- **Raises:** `ValueError` if matrix is not square or is singular

### `rank(matrix)`

Return the rank of a matrix.

- **Parameters:** `matrix` - Input matrix
- **Returns:** Rank as integer

## Development

```bash
# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/
```

## Dependencies

- Python >= 3.8
- NumPy

## License

MIT