DOC PREVIEW
CORNELL CS 404 - Lecture Slides

This preview shows page 1-2 out of 7 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1OutlineOutline• Announcements– HWI key posted later– HWII revised– Sign-up for CTC account• HW I issues• HW II status• Why are there free libraries?• Software licensing spectrum• Software and scientific ethicsHW I IssuesHW I Issues• Some problems:– cc -lm csin.c -ocsin• -lm tells compiler to find a library called “libm.a,”and get any routines it needs– Searching LAPACK• much easier to go through LAPACK “QuickSearch” than through GAMSHW I IssuesHW I Issues• Calling BLAS– Look on BLAS sheet for routines that do y<-Ax• nothing matches, but find several routines that solvey<-aAx+by– CALL SGEMV('n',m,n,1.0,C,NMAX,v,1, 0.0, PC, 1)• As a matrix, C is m-by-n, but as an array, it is NMAX-by-KMAX• BLAS needs both: NMAX (LDA) lets BLAS know wherecolumns start• Also, a & b should be real (1.0 and 0.0, 1 and 0 won’twork on some systems)2BLAS IncrementsBLAS Increments• BLAS lets (makes) you specify anincrement.– Allows you to use 2D arrays as vectors:????????16128415117314106213951 INC=6INC=7HW II--The last wordHW II--The last word• Not sure ACCEL will get MATLAB C Libraryinstalled– I’m not entirely happy with the library though• Rather than focusing on the MATLAB libraryyou must figure out how to call a C subroutinefrom FpcaPS– C routine is called SaveToMat--use it to save PC to afile– If MATLAB library becomes available, can useSaveToMat to save PC to a .mat fileC-Preprocessor DirectivesC-Preprocessor Directives• There are really two versions ofSaveToMat in savemat.c– if the line “#define MATLAB” appears at thetop, then the routine will call MATLABroutines– if it doesn’t appear (or #undefine MATLAB)appears, then the MATLAB calls areremoved by the C-Preprocessor and theMATLAB library is not called3DisclaimerDisclaimer• The legal information presented below is forentertainment (and edification) only. No oneshould be trusted on legal matters, except alawyer. Even then, I’d be careful.• Use of this information in a mannerinconsistent with the product label is aviolation of Federal law• Side effects may include, headaches, nausea,severe boredom, loss of appetiteA Free Lunch?A Free Lunch?• Lots of free code available from NETLIB,GAMS, and WWW– Why doesn’t NETLIB charge a fee?– Is it really free?Software Licensing SpectrumSoftware Licensing Spectrum• Can classify software (source code)based on– limitations on viewing– limitations on use– limitations on distribution• No license------>GPL------>Proprietary• Unprotected---->Copyrighted---->Patented---->Secret4CopyrightsCopyrights• In the United States, the copyright and patent lawswere created to– “to promote the Progress of Science and useful Arts, by securing forlimited Times to Authors and Inventors the exclusive Right to theirrespective Writings and Discoveries.”• Legally, software is considered “Writings” and isprotected by copyright– Your work is automatically copyrighted if it is original,creative, and fixed in some medium– Your code is automatically protected from unauthorizedcopying under copyright laws– You can make the copyright more explicit by formallyregistering:• www.loc.gov/copyright/forms -- cost $30CopyrightsCopyrights• But, copyright law only protects thedocument– ideas and concepts are not covered• Ex: Code to do LU factorization is protected, butthe idea of LU factorization is not protected• Can always write your own implementationPatentsPatents• Patents are meant to cover ideas andconcepts• To get a patent, the invention must benovel– no one has ever done this before– revolutionary, not evolutionary• Patents entitle you exclusive rights tocopy, reproduce, or use your invention5PatentsPatents• But, getting a patent– takes a long time– cost money (legal and registration fees)• And may not be possible, at least for you.• Grad students, post-docs, faculty signedpatent rights to Cornell– Applies to patents developed during official work– Still free to tinker in your garage• Undergrads are unrestrictedRelevance to ScienceRelevance to Science• Our scientific careers depend on howothers view our work– We want people to see and use our code– Practically, we hope this will increase ourstature (more citations)– Ethically, science has always relied on anopen exchange of ideas• Being too protective of our code goes against thisRelevance to ScienceRelevance to Science• We want people to use our stuff, but– we don’t want them making money withoutgiving us a piece of the action– we don’t want to be liable if somebody doessomething stupid (including us)• A software license allows you to letpeople see/copy your work, subject tothe conditions you specify– An explicit exception to copyrights6GNU General Public LicenseGNU General Public License• The software “club” GNU has developed a“General Public License” (GPL)• The GPL allows someone to see/use/modifyyour code, IF– they document changes they made (so they reflecton their reputation, not yours)– they distribute any program derived from your workunder the same license (so they can’t steal yourwork)– they agree not to sue you if they (or your program)do something stupidGNU General Public LicenseGNU General Public License• Under the GPL,– You can charge people todownload your program• but, they can demandeverything, including sourcecode and can modify it• This keeps the software “free”GNU General Public LicenseGNU General Public License• To apply GPL to your work, include theofficial statement in a license orREADME file or comments in the source• The official statement says things like– This program is free software; you can redistribute itand/or modify it under the terms of the GNU General PublicLicense– This program is distributed in the hope that it will beuseful, but WITHOUT ANY WARRANTY; without even the impliedwarranty of MERCHANTABILITY or FITNESS FOR A PARTICULARPURPOSE.– See http://www.gnu.org/copyleft/gpl.htmlfor more info7EthicalEthical Issues Issues• If someone puts there code on the web,without explicit licensing/restrictions– They guarantee nothing (it may not evencompile)– They assert no rights (they must assumepeople will copy it)– This means, you can do whatever you wantwith it (legally)Ethical IssuesEthical Issues• Ethically, you need to acknowledge theircontribution to your work– Ex: When writing a paper, it is unethical to


View Full Document

CORNELL CS 404 - Lecture Slides

Download Lecture Slides
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Slides and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Slides 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?