{ "info": { "author": "Luis Ulloa", "author_email": "ulloa@stanford.edu", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# linear-algebra-ulloa\nimplemented vector and matrix classes with reST-formatted docstrings in Python 3+\n\n## General Layout\n\n\n\nThe Vector class imitates the m x 1 vector from linear algebra and\ncontains many useful functions for dealing and interacting with Vectors.\n\nGetting values directly from the vector should be done using the get(index)\nfunction or [] operator since the comp vector location in memory may change with functions\nlike mag() or zero() (those which change current vector comp).\n\n class Vector\n\n __init__(comp) - takes in a list of components or a valid mx1 Matrix\n\n resize(length) - while preserving current elements or filling with 0's, changes current vector length\n\n set(comp, index=-1) - sets entire list at once or one specific index/value\n\n get(index) - returns item at specified index of vector\n\n zero() - turns the current vector into a zero vector and returns it\n\n mag() - returns the magnitude of current vector\n\n normalize(change=False) - returns normalized current vector, if change=True, internal vector is updated\n\n same_normalized(other) - returns True/False depending on equality of the two vectors once normalized\n\n dot(other) - returns the dot product of th two vectors\n\n cross(other) - returns the cross product of u x v (u is current vector, v is other)\n\n perp(other) - returns True/False if current and other are/aren't perpendicular\n\n parallel(other) - returns True/False if current and other are/aren't parallel\n\n indep(other) - returns True/False if curr vector and other vector(s) are linearly independent\n\n operator + - returns sum of two vectors, component wise addition\n\n operator - - returns difference of two vectors, component wise subtraction\n\n operator * - alternate for dot product, or can use for vector scaling\n\n operator ** - returns original vector with its components raised to power\n\n operator == - checks to see if lists are equal\n\n to string method - format: \"\"\n\n len() method - can use len() to get vector length\n\n get and set [] - user can get and set values in vector with index based operations []\n\n\n comp = vector composition, list of components\n\n length = number of components in vector\n\n rows = same as length, used with cols for backwards compatibility with Matrix\n\n cols = 1 (num of columns)\n\n\nThe Matrix class imitates the matrix concept from linear algebra and allows\nfor different ways of dealing and interacting with matrices and vectors.\n\nGetting values directly from the vector should be done using the get(row, col)\nfunction or [], [][] operator since the matrix comp location in memory may change with functions\nthat change the underlying data type.\n\n class Matrix\n\n __init__(comp) - takes in a list of components or a valid Vector\n\n resize(rows, cols) - while preserving current elements or filling with 0's, changes current vector length\n\n set(comp, index=None) - sets entire list at once or one specific index/value (tuple or array as (row, col))\n\n get(row=None,col=None) - can get a specific row, column, or entire matrix composition (no args for matrix)\n\n zero() - replaces values in current matrix with all zeroes and returns it\n\n det() - takes the determinant of the current NxN matrix\n\n transpose() - transposes the current mxn matrix to an nxm matrix (1st row becomes 1st col, etc.)\n\n row_echelon() - returns the current matrix in row echelon form\n\n row_reduce() - returns the current matrix to reduced row echelon form\n\n identity(n) - static method that returns the nxn identity matrix\n\n combine(first, second) - static method that combines two matrices by concatenation\n\n inverse() - returns the inverse of current nxn matrix, or None if singular\n\n operator + - returns sum of two matrices, component wise addition\n\n operator - - returns difference of two matrices, component wise subtraction\n\n operator * - matrix multiplication, matrix-vector product, scalar multiplication\n\n operator ** - returns original matrix with its components raised to power\n\n operator == - checks to see if internal lists are equal\n\n to string method - format: \"[row1\\n row2\\n row3\\n ...]\" and floats are shown as fractions\n\n len() method - returns tuple formatted as (row, col)\n\n get and set [][] - can get rows and specific values with [] or [][], and set specific values with [][]\n\n\n comp = matrix composition, list of lists where each list is a row\n\n rows = number of rows in matrix\n\n cols = number of columns in matrix\n\n## Tests\n\nThere is a file for writing tests. At the moment, it is only a series of assertions. In the future, I will update the testing file to use a more standardized version/library for testing.\n\n## Docstrings/Documentation\n\nThere is thorough documentation throughout the library. Python library contains a help() function that could be used to view the docstrings for a specific class/method.\n\nClass: help(classname)\n\nMethod: help(classname.methodname)\n\nFor example, help(Vector.resize) shows you ...\n\n resize(self, length)\n\n Re-sizes the vector to the specified length. If length is greater than\n\n current size, the new components are initialized with 0, otherwise if length\n\n is less than current size, the last few components are lost.\n\n :param length: new length of vector\n\n :type length: int\n\n :return: current vector, now resized\n\n :rtype: Vector\n\nand vice versa. help(Vector) and help(Matrix) return major class overviews.\n\n## Using library\n\npip:\n\n pip install linear-algebra-ulloa\n\nor \n\n pip3 install linear-algebra-ulloa\n\nUse\n\n from linear_lib.linear import *\n\nto be able to create and utilize vector and matrix classes without\nthe linear.Vector or linear.Matrix prefix.\n\n## Potential additions to library in future\n\n### Vector Class\n\n* ~~Method for checking if current vector and other vector are orthogonal~~\n\n* Support for plotting/graphing a certain amount of 2D maybe 3D vectors using matplotlib or a similar library\n\n* ~~Cross products~~\n\n### Matrix Class\n\n* ~~Determinant~~\n\n* ~~Row Reducing Matrices~~\n\n* ~~Finding inverse of Matrices~~\n\n* ~~Transposing matrices~~\n\n* Standalone function for fitting a straight line with least squares approximation\n\n* General least squares method as part of matrices class\n\n### Additional\n\n* ~~index access with [] [][] operator~~\n\n* ~~identify whether a set of vectors are linearly independent~~\n\n* ~~identify whether two vectors are parallel~~\n\n* ~~static method for generating arbitrarily sized identity matrix~~\n\n* ~~static method for concatenating two matrices~~\n\n* ~~floats are shown as proper fractions when printed~~\n\n* ~~equality tests account for floating point error~~\n\n\n\n\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ulloaluis/linear-algebra", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "linear-algebra-ulloa", "package_url": "https://pypi.org/project/linear-algebra-ulloa/", "platform": "", "project_url": "https://pypi.org/project/linear-algebra-ulloa/", "project_urls": { "Homepage": "https://github.com/ulloaluis/linear-algebra" }, "release_url": "https://pypi.org/project/linear-algebra-ulloa/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "Vector/Matrix classes - refined rref and fixed a bug. Added author information.", "version": "0.0.2" }, "last_serial": 4133542, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "a0eeb2930ad4cc240da85916707726d4", "sha256": "f1a6bc9c12d9be2aff2212697f0185c48a3a109ffbbb078a30c6f37502873aab" }, "downloads": -1, "filename": "linear_algebra_ulloa-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a0eeb2930ad4cc240da85916707726d4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16853, "upload_time": "2018-08-03T08:05:09", "url": "https://files.pythonhosted.org/packages/2f/72/860bb720cc309d38ba6fc4d0c88ec61d749575505ae8c96a30d4200d0cec/linear_algebra_ulloa-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "28950e439157464db5fbec2fa1cbc4ff", "sha256": "8232e850c60bdd0c6f76fddefb8f6f94782b5d7edbc574af2c2673cfa49d5170" }, "downloads": -1, "filename": "linear_algebra_ulloa-0.0.1.tar.gz", "has_sig": false, "md5_digest": "28950e439157464db5fbec2fa1cbc4ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15349, "upload_time": "2018-08-03T08:05:10", "url": "https://files.pythonhosted.org/packages/83/86/b4f19a6ded3f5f21f4ec24838a29ea6e28c70495f1ecd20d4028bb15cf7e/linear_algebra_ulloa-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "2c5493153d7867074218d1974d5bd633", "sha256": "05852fa2dd1d908aed2d66979a152a4d434bb5b436713945ab2cf6e78feb4d3a" }, "downloads": -1, "filename": "linear_algebra_ulloa-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "2c5493153d7867074218d1974d5bd633", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16935, "upload_time": "2018-08-03T18:42:20", "url": "https://files.pythonhosted.org/packages/54/8d/d92d0a351a8bd774c57369ab43a19e8b5ea434ad6a2cf7474afbbf5a2853/linear_algebra_ulloa-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "91f3ffcc4e1bbc1cb5eff4620dbce14b", "sha256": "5485a8717016e2819b5548e28a03a06c5c03f72cdf273ad982ddcf842708581d" }, "downloads": -1, "filename": "linear_algebra_ulloa-0.0.2.tar.gz", "has_sig": false, "md5_digest": "91f3ffcc4e1bbc1cb5eff4620dbce14b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15430, "upload_time": "2018-08-03T18:42:22", "url": "https://files.pythonhosted.org/packages/dd/c3/f7184675dcd58d9214d660b703c3a19ac9579159b338ebd297820fcd5830/linear_algebra_ulloa-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2c5493153d7867074218d1974d5bd633", "sha256": "05852fa2dd1d908aed2d66979a152a4d434bb5b436713945ab2cf6e78feb4d3a" }, "downloads": -1, "filename": "linear_algebra_ulloa-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "2c5493153d7867074218d1974d5bd633", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16935, "upload_time": "2018-08-03T18:42:20", "url": "https://files.pythonhosted.org/packages/54/8d/d92d0a351a8bd774c57369ab43a19e8b5ea434ad6a2cf7474afbbf5a2853/linear_algebra_ulloa-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "91f3ffcc4e1bbc1cb5eff4620dbce14b", "sha256": "5485a8717016e2819b5548e28a03a06c5c03f72cdf273ad982ddcf842708581d" }, "downloads": -1, "filename": "linear_algebra_ulloa-0.0.2.tar.gz", "has_sig": false, "md5_digest": "91f3ffcc4e1bbc1cb5eff4620dbce14b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15430, "upload_time": "2018-08-03T18:42:22", "url": "https://files.pythonhosted.org/packages/dd/c3/f7184675dcd58d9214d660b703c3a19ac9579159b338ebd297820fcd5830/linear_algebra_ulloa-0.0.2.tar.gz" } ] }