Skip to content

Commit

Permalink
apply patch for configure --prefix option
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchicool committed Apr 6, 2015
1 parent e8daed9 commit cec6c09
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
17 changes: 10 additions & 7 deletions src/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
srcdir = @srcdir@
RM = rm
CC = @CC@
CFLAGS = @CFLAGS@ -DUSECONFIG_H
LDFLAGS = @LDFLAGS@ -lm
INSTALL = @INSTALL@
BINDIR = /usr/local/bin
SRCDIR = @srcdir@
RM = rm
CC = @CC@
CFLAGS = @CFLAGS@ -DUSECONFIG_H
LDFLAGS = @LDFLAGS@ -lm
INSTALL = @INSTALL@
prefix ?= @prefix@
exec_prefix ?= @exec_prefix@
BINDIR ?= @bindir@

SRC = bayes.c command.c model.c mcmc.c likelihood.c proposal.c sumpt.c utils.c mbbeagle.c best.c
OBJECTS = bayes.o command.o model.o mcmc.o likelihood.o proposal.o sumpt.o utils.o mbbeagle.o best.o
Expand All @@ -16,6 +18,7 @@ mb: $(OBJECTS)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

install: $(PROGS)
mkdir -p $(BINDIR)
$(INSTALL) -m 755 $(PROGS) $(BINDIR)

clean:
Expand Down
16 changes: 8 additions & 8 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -12622,7 +12622,7 @@ MrBFlt LnPriorProbLognormal (MrBFlt val, MrBFlt *params)

z = (log(val) - params[0]) / params[1];

return -log(params[1] * val * sqrt(2.0 * PI)) - z * z / 2.0;
return - log(params[1] * val * sqrt(2.0 * PI)) - z * z / 2.0;
}


Expand All @@ -12636,7 +12636,7 @@ MrBFlt LnPriorProbLognormal_Param_Mean_Sd (MrBFlt val, MrBFlt *params)

z= (log(val) - mean_log) / sd_log;

return -log(sd_log * val * sqrt(2.0 * PI)) - z * z / 2.0;
return - log(sd_log * val * sqrt(2.0 * PI)) - z * z / 2.0;
}


Expand All @@ -12647,7 +12647,7 @@ MrBFlt LnPriorProbNormal (MrBFlt val, MrBFlt *params)

z = (val - params[0]) / params[1];

return -log(params[1] * sqrt(2.0 * PI)) - z * z / 2.0;
return - log(params[1] * sqrt(2.0 * PI)) - z * z / 2.0;
}


Expand Down Expand Up @@ -12710,7 +12710,7 @@ MrBFlt LnPriorProbOffsetLognormal (MrBFlt val, MrBFlt *params)

z = (log(x) - mean_log) / sd_log;

return -log(sd_log * x * sqrt(2.0 * PI)) - z * z / 2.0;
return - log(sd_log * x * sqrt(2.0 * PI)) - z * z / 2.0;
}


Expand All @@ -12727,7 +12727,7 @@ MrBFlt LnPriorProbOffsetLognormal_Param_Offset_Mean_Sd (MrBFlt val, MrBFlt *para

z = (log(x) - mean_log) / sd_log;

return -log(sd_log * x * sqrt(2.0 * PI)) - z * z / 2.0;
return - log(sd_log * x * sqrt(2.0 * PI)) - z * z / 2.0;
}


Expand All @@ -12741,7 +12741,7 @@ MrBFlt LnPriorProbTruncatedNormal (MrBFlt val, MrBFlt *params)
z_0 = (0.0 - params[0]) / params[1];
normConst = CdfNormal(z_0);

return -log(params[1] * sqrt(2.0 * PI)) - z * z / 2.0 - log(normConst);
return - log(params[1] * sqrt(2.0 * PI)) - z * z / 2.0 - log(normConst);
}


Expand All @@ -12755,14 +12755,14 @@ MrBFlt LnPriorProbTruncatedNormal_Param_Trunc_Mean_Sd (MrBFlt val, MrBFlt *param
z_trunc = (params[0] - params[1]) / params[2];
normConst = CdfNormal(z_trunc);

return -log(params[2] * sqrt(2.0 * PI)) - z * z / 2.0 - log(normConst);
return - log(params[2] * sqrt(2.0 * PI)) - z * z / 2.0 - log(normConst);
}


/* Calculate probability of a realization for uniform random variable */
MrBFlt LnPriorProbUniform (MrBFlt val, MrBFlt *params)
{
return -log(params[1] - params[0]);
return - log(params[1] - params[0]);
MrBayesPrint ("%lf", val); /* just because I am tired of seeing the unused parameter error msg */
}

Expand Down
1 change: 0 additions & 1 deletion src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ struct complex
MrBFlt re;
MrBFlt im;
};

typedef struct complex complex;

typedef struct
Expand Down

0 comments on commit cec6c09

Please sign in to comment.