Permalink
Browse files

moved Sim to heap

  • Loading branch information...
ShantaoL committed Sep 28, 2015
1 parent 7cb3e38 commit 5531ceacf877480d8137a9d9ca0b00efb30124f7
Showing with 77 additions and 1 deletion.
  1. +22 −0 .gitignore
  2. +55 −1 surface_residue/code_pack/surfaceProbe.c
View
@@ -0,0 +1,22 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler config.
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
# Ignore all logfiles and tempfiles.
/log/*
!/log/.keep
/tmp
# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
@@ -1,3 +1,45 @@
/*
* University of Illinois Open Source License
* Copyright 2009, 2011, 2012 Luthey-Schulten Group,
* All rights reserved.
*
* Developed by: Luthey-Schulten Group
* University of Illinois at Urbana-Champaign
* http://www.scs.uiuc.edu/~schulten
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the Software), to deal with
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to
* do so, subject to the following conditions:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimers.
*
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimers in the documentation
* and/or other materials provided with the distribution.
*
* - Neither the names of the Luthey-Schulten Group, University of Illinois at
* Urbana-Champaign, nor the names of its contributors may be used to endorse or
* promote products derived from this Software without specific prior written
* permission.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS WITH THE SOFTWARE.
*
* Author(s): Anurag Sethi, John Eargle
* Modifications by: Shantao Li, Declan Clarke (lab of Mark Gerstein,
* Yale University, 2015)
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1150,12 +1192,19 @@ void sort(bindingSite *allSites, float *LC, int nSim)
void mergeBindingSites(bindingSite *allSites, int Ntrials, float *LC)
{
int i, j, k;
float Sim[Ntrials][Ntrials];
// float Sim[Ntrials][Ntrials];
float **Sim;
float max = 0.;
int mergingSites;
Sim = calloc(sizeof(float*), Ntrials);
for (i=0; i<Ntrials; i++)
Sim[i] = calloc(sizeof(float), Ntrials);
printf("->merging Sites\n");
k = 0;
for (i=0; i<Ntrials; i++)
{
@@ -1214,6 +1263,11 @@ void mergeBindingSites(bindingSite *allSites, int Ntrials, float *LC)
}
printf("<-merging Sites\n");
for (i=0; i<Ntrials; i++)
free(Sim[i]);
free(Sim);
return;
}

0 comments on commit 5531cea

Please sign in to comment.