Commit 37aae6db authored by Kittipong Maneewong's avatar Kittipong Maneewong

add Quiz1

parent efacfbe9
This diff is collapsed.
# linear
linear python library
[![Circle CI](https://circleci.com/gh/Kittipong Maneewong/linear/tree/develop.svg?style=svg)](https://circleci.com/gh/Kittipong Maneewong/linear/tree/develop)
# CircleCI Configuration file
machine:
python:
version: 2.7.11
general:
artifacts:
- "dist"
- "cover"
dependencies:
override:
- pip install tox tox-pyenv
- pyenv local 2.7.11 3.5.1 # Should correspond to pre-installed Python versions on CircleCI
test:
override:
- tox
deployment:
pypi:
tag: /[0-9]+(\.[0-9]+)*/
owner: Kittipong Maneewong
commands:
- echo "[distutils]" > ~/.pypirc
- echo "index-servers =" >> ~/.pypirc
- echo " pypi" >> ~/.pypirc
- echo >> ~/.pypirc
- echo "[pypi]" >> ~/.pypirc
- echo "username:$PYPI_USERNAME" >> ~/.pypirc
- echo "password:$PYPI_PASSWORD" >> ~/.pypirc
- echo >> ~/.pypirc
- python setup.py register -r pypi
- python setup.py sdist upload -r pypi
import numpy as np
def Ab2Uc(A, b):
A=np.array(A,float)
b=np.array(b,float)
n=len(b)
for k in range(0,n-1):
for i in range(k+1,n):
if A[i,k] != 0.0 :
lam=A[i,k]/A[k,k]
A[i,k]=0
A[i,k+1:n]-=lam*A[k,k+1:n]
b[i]-=lam*b[k]
U=A.copy()
print ('U = {}'.format(U))
c=b.copy()
print ('c = {}'.format(c))
A = [
[4, -2, 1],
[-2, 4, -2],
[1, -2, 4]
]
b = [
11,
-16,
17
]
"""
Example test.
"""
from hamcrest import (
assert_that,
equal_to,
is_,
)
def test_math():
assert_that(1 + 1, is_(equal_to(2)))
[flake8]
max-line-length = 120
max-complexity = 15
#!/usr/bin/env python
from setuptools import find_packages, setup
project = "linear"
version = "0.1.0"
setup(
name=project,
version=version,
description="linear python library",
author="Kittipong59110440039",
author_email="kittipong.ma.59@ubu.ac.th",
url="https://github.com/Kittipong Maneewong/linear",
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
include_package_data=True,
zip_safe=False,
install_requires=[
],
setup_requires=[
"nose>=1.3.6",
],
dependency_links=[
],
entry_points={
},
tests_require=[
"coverage>=3.7.1",
"mock>=1.0.1",
"PyHamcrest>=1.8.5",
],
)
[tox]
envlist = py27, py35, lint
[testenv]
commands =
python setup.py nosetests --with-coverage --cover-package=linear --cover-erase --cover-html
python setup.py sdist
deps =
setuptools>=17.1
[testenv:lint]
commands=flake8 linear
basepython=python2.7
deps=
flake8
flake8-print
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment